/* assets/css/style.css */
:root {
    --bg-color: #05070a;
    --card-bg: rgba(22, 27, 34, 0.7);
    --primary-color: #d4af37;
    /* Gold */
    --primary-color-rgb: 212, 175, 55;
    --accent-color: #00f2ff;
    /* Cyber Blue */
    --accent-color-rgb: 0, 242, 255;
    --text-color: #f0f6fc;
    --text-muted: #8b949e;
    --border-color: rgba(48, 54, 61, 0.8);
    --hover-bg: rgba(33, 38, 45, 0.9);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    /* Widened for PC */
    margin: 0 auto;
    padding: 2rem;
    padding-bottom: 8rem;
    flex: 1 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideDown 0.8s ease-out;
    padding-top: 4rem;
    /* Space for nav */
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    text-align: left;
    gap: 1rem;
    padding-top: 3.5rem;
}

.search-header h1 {
    font-size: 2rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-actions .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-header {
        padding-top: 3rem;
    }

    .search-header h1 {
        font-size: 1.6rem;
    }
}

/* Global Navigation */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 1.2rem;
    /* Slightly tighter to fit more items */
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Navigation Toggle (Animated) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: left center;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

@media (max-width: 900px) {
    .nav-menu {
        display: none;
        position: fixed;
        /* Use fixed for full screen overlay effect on mobile if needed */
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(5, 7, 10, 0.98);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.2rem;
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 1050;
        border-left: 1px solid var(--glass-border);
    }

    .nav-menu.active {
        display: flex;
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

h1 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to bottom, #fff 20%, #ffc1e3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 20px rgba(255, 193, 227, 0.3);
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 193, 227, 0.2));
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: none;
    margin-top: 0.5rem;
    font-weight: 700;
    opacity: 0.9;
}

.sub-caption {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 0.85rem;
    color: #ffb7d5;
    margin-top: 0.5rem;
    opacity: 0.9;
    font-weight: 700;
}

/* Portal-like Components */
.content-box {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 3rem;
}

.description-home {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--text-color);
}

.btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 0.8rem;
}

.grid-btn i {
    font-size: 2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.grid-btn span {
    font-weight: 700;
    font-size: 1rem;
}

/* ボタン下部の説明文: タイトルより小さく・薄く表示して視覚的な差をつける */
.grid-btn small {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    margin-top: -0.2rem;
}

.grid-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.grid-btn:hover i {
    transform: scale(1.1);
}

.grid-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), #b8860b);
    color: #000;
    border: none;
}

.grid-btn.primary i,
.grid-btn.primary small {
    color: #000;
}

/* Home Quick Search */
.search-box-home {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    transition: all 0.3s;
}

.search-box-home:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.search-box-home input {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    padding: 0.5rem 0;
}

.search-box-home i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Landing Page Buttons */
.landing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .landing-grid {
        display: flex;
        flex-direction: column;
    }
}

.reveal-animation {
    animation: revealDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes revealDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
        overflow: hidden;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 10000px;
    }
}

.results-section {
    margin-top: 1rem;
    margin-bottom: 5rem;
    scroll-margin-top: 2rem;
    position: relative;
    padding-bottom: 5rem;
}

.recent-section {
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

.nav-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.nav-card:hover::before {
    transform: translateX(100%);
}

.nav-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.15);
}

.nav-card i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--primary-color);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

.nav-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.nav-card p {
    color: var(--text-muted);
}

/* Forms */
.form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow);
    max-width: 700px;
    /* Default narrow layout */
    margin: 0 auto;
    transition: max-width 0.3s ease;
}

.form-container.wide {
    max-width: 1350px;
    /* Widened for PC */
}

.form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    align-items: start;
}

.live-preview-section {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    /* Following scroll on PC */
    z-index: 10;
    padding-right: 5px;
    padding-bottom: 2rem;
}

.live-preview-section::-webkit-scrollbar {
    width: 4px;
}

.live-preview-section::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Ensure preview card shows everything */
.live-preview-section .eq-card.mini .eq-properties {
    max-height: none;
    -webkit-line-clamp: initial;
    line-clamp: initial;
    overflow: visible;
}

.preview-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 1000px) {
    .form-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .live-preview-section {
        position: static;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid var(--glass-border);
    }
}

footer {
    background: rgba(10, 15, 20, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    text-align: center;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* New Property Editor Layout */
.property-editor-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    /* Widened selector for better visibility on PC */
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    min-height: 400px;
}

@media (max-width: 768px) {
    .property-editor-container {
        grid-template-columns: 1fr;
        padding: 0.5rem; /* パディングを削って横幅を確保 */
        background: none;
        border: none;
    }
}

.prop-selector {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    padding-right: 5px;
    max-height: 600px;
    border-right: 1px solid var(--glass-border);
}

.custom-prop-add {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.custom-prop-label {
    font-size: 0.75rem;
    color: #ffcc00;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.custom-prop-input-group {
    display: flex;
    gap: 0.5rem;
}

.custom-prop-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: var(--text-color);
    font-size: 0.85rem;
}

.custom-prop-input:focus {
    border-color: var(--primary-color);
    outline: none;
    background: rgba(var(--primary-color-rgb), 0.05);
}

@media (max-width: 768px) {
    .prop-selector {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 1rem;
        max-height: 300px;
    }
}

.prop-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.prop-vertical-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-color);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prop-vertical-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border);
}

.prop-vertical-btn::after {
    content: '+';
    opacity: 0.5;
    font-size: 1.2rem;
}

.prop-inputs-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prop-inputs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}

.prop-inputs-area {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* --- Property Editor Overhaul (Mobile First) --- */
.prop-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

/* スマホでは「枠」をなくしてスッキリさせる */
@media (max-width: 600px) {
    .prop-input-row {
        background: none;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
        padding: 0.8rem 0.2rem;
        box-shadow: none;
        gap: 0.5rem;
    }

    .helper-btn, .prop-row-value, .sign-toggle-btn {
        height: 38px !important;
        font-size: 0.85rem !important;
    }

    .prop-row-value {
        width: 100% !important;
        max-width: 180px !important; /* 6桁対応 */
        min-width: 140px !important;
    }

    .helper-btn {
        width: 42px !important;
    }

    .unit-btn {
        font-size: 0.65rem !important; /* ユニットボタンも小さく */
    }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Reordering Handles */
.prop-reorder-btns {
    position: absolute;
    top: 50%;
    left: -40px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 5;
}

@media (max-width: 1100px) {
    .prop-reorder-btns {
        position: static;
        flex-direction: row;
        transform: none;
        margin-bottom: 0.4rem;
        width: 100%;
        justify-content: flex-end;
        gap: 0.8rem;
    }
}

.reorder-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.reorder-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-color);
}

/* Prop Info Section */
.prop-row-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem; /* 名前と条件の間に十分な距離 */
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.8rem;
    width: 100%;
}

.prop-row-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--primary-color);
    white-space: nowrap;
}

.cond-click-area {
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.cond-click-area:hover {
    background: rgba(var(--accent-color-rgb), 0.2);
}

/* Value Input Area */
.prop-value-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.prop-row-value {
    width: 100%;
    max-width: 200px;
    height: 42px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.helper-btn-row {
    display: flex;
    flex-direction: row; /* 確実に横並びにする */
    gap: 0.4rem;
    justify-content: center;
    width: 100%;
}

.helper-btn {
    height: 38px;
    width: 44px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.helper-btn:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.95);
}

/* Unit Selection Area */
.unit-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-shrink: 0;
}

.sign-toggle-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    color: #ffcc00;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}

.unit-btn-group {
    flex: 1;
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 2px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    min-width: 160px; /* 潰れ防止 */
}

.unit-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem; /* 文字が入り切るように少し小さく */
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    padding: 0 4px;
}

.unit-btn.active {
    background: var(--accent-color);
    color: #000;
}

.unit-btn[data-unit="flag"].active {
    background: #ffcc00;
}

.prop-row-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden { display: none !important; }

/* PC specific overrides */
@media (min-width: 1100px) {
    .prop-reorder-btns {
        left: -48px;
    }

    .prop-input-row {
        flex-direction: row; /* PCでは横並びを基本とするが */
        align-items: center;
        gap: 1.5rem;
        padding-right: 60px;
    }

    .prop-row-info {
        flex: 0 1 180px; /* 名前・条件エリア */
        border-bottom: none;
        padding-bottom: 0;
    }

    .prop-value-group {
        flex: 1 1 auto; /* 数値エリアが中央で広がる */
        max-width: 300px;
    }

    .unit-row {
        flex: 0 0 240px; /* ユニット選択は右側固定 */
    }

    .prop-row-delete {
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
    }
}

/* 全体的な微調整：折り返し時の余白 */
.prop-input-row > div {
    display: flex;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), #b8860b);
    color: #000;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    box-shadow: none;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Equipment Cards */
.equipment-grid,
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
    /* Fix for overlapping/height issues */
}

/* Fix for overlapping in mini-view */
.mini-view {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.eq-card.mini {
    padding: 1rem;
    border-top-width: 2px;
}

.eq-card.mini .eq-name {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eq-card.mini .eq-category {
    font-size: 0.65rem;
    padding: 2px 8px;
    margin-bottom: 0.5rem;
}

.eq-card.mini .eq-properties {
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0.7rem;
    max-height: 80px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.eq-card.mini .btn-edit-card {
    width: 28px;
    height: 28px;
    top: 0.5rem;
    right: 0.5rem;
}

.eq-card.mini .btn-edit-card i {
    font-size: 0.8rem;
}

.eq-card.mini .eq-footer {
    display: none;
    /* Hide contributor and date to keep it simple */
}

.eq-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-top: 3px solid var(--primary-color);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.eq-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.btn-edit-card {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.btn-edit-card:hover {
    background: var(--primary-color);
    color: #000;
    transform: rotate(90deg) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.btn-edit-card i {
    font-size: 1.1rem;
}

.eq-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.eq-atk-def {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: rgba(0, 242, 255, 0.1);
    border-radius: 4px;
}

.eq-category {
    font-size: 0.8rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.eq-category.cat-main_weapon {
    background: rgba(255, 68, 68, 0.2);
    color: #ff6666;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.eq-category.cat-armor {
    background: rgba(68, 255, 68, 0.2);
    color: #66ff66;
    border: 1px solid rgba(68, 255, 68, 0.3);
}

.eq-category.cat-additional {
    background: rgba(255, 255, 68, 0.2);
    color: #ffff66;
    border: 1px solid rgba(255, 255, 68, 0.3);
}

.eq-category.cat-special {
    background: rgba(204, 68, 255, 0.2);
    color: #cc66ff;
    border: 1px solid rgba(204, 68, 255, 0.3);
}

.eq-category.cat-sub_weapon {
    background: rgba(68, 136, 255, 0.2);
    color: #66aaff;
    border: 1px solid rgba(68, 136, 255, 0.3);
}

.eq-badge-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.eq-badge-group .eq-category {
    margin-bottom: 0;
}

.eq-category.cat-sub {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.list-sub-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    border: 1px solid var(--glass-border);
    font-weight: normal;
}

.eq-properties {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    border-left: 3px solid var(--accent-color);
}

/* Property Ranking Groups */
.prop-group-details {
    width: 100%;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s;
}

.prop-group-details[open] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

.prop-group-summary {
    padding: 0.8rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    transition: background 0.2s;
}

.prop-group-summary::-webkit-details-marker {
    display: none;
}

.prop-group-summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.prop-group-summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    transition: transform 0.3s;
    opacity: 0.5;
}

.prop-group-details[open] .prop-group-summary::after {
    transform: rotate(180deg);
}

.group-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 1rem;
}

.prop-group-content {
    padding: 1rem;
    padding-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.eq-history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eq-history-row {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.eq-history-row i {
    color: var(--primary-color);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.eq-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--glass-border);
}

/* Search Bar & Buttons */
.search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 100px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    font-weight: 600;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.filter-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Full Set Preview */
.set-preview {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.05), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
}

.set-preview::after {
    content: 'EQUIPMENT SET';
    position: absolute;
    top: -10px;
    left: 2rem;
    background: var(--accent-color);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 4px;
}

/* Responsive */
/* Selection Buttons (Category/SubCategory) */
.selection-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.select-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.select-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

.select-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Ranking Styles */
.rank-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--primary-color);
    z-index: 10;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #000;
    border-color: #fff;
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #707070);
    color: #000;
    border-color: #fff;
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #000;
    border-color: #fff;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--primary-color), transparent);
}

.prop-value-highlight {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.negative-val {
    color: #ff4d4d !important;
}

/* --- Mobile Optimized Search Results (Grouped List) --- */
.search-result-group {
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-color);
}

.group-header-icon {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.group-header-label {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-color);
    letter-spacing: 1px;
}

.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.8rem;
    position: relative;
}

.search-result-item:hover, .search-result-item:active {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.item-main-info {
    flex: 1;
    min-width: 0; /* Allow truncation */
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.item-stat-badge {
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
}

.item-category-tag {
    font-size: 0.7rem;
    opacity: 0.8;
}

.item-action {
    color: var(--primary-color);
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.search-result-item:hover .item-action {
    opacity: 1;
}

/* 320px Screen Optimization */
@media (max-width: 360px) {
    .search-result-item {
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }
    .item-name {
        font-size: 0.85rem;
    }
    .item-meta {
        font-size: 0.7rem;
    }
    .item-stat-badge {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
}

/* Search Grid & Mini Cards */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 性能ランキング（リスト表示）の時はグリッドを解除して縦に並べる */
.search-grid:has(.search-result-group) {
    display: block;
}

.search-grid.mini-view {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}

.eq-card.mini {
    padding: 1.2rem;
    min-height: auto;
    border-top-width: 2px;
}

.eq-card.mini .eq-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.eq-card.mini .eq-properties {
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.eq-card.mini .eq-footer {
    margin-top: 0.8rem;
    padding-top: 0.5rem;
}

.eq-card.mini .eq-contributor {
    font-size: 0.75rem;
}

/* Hover & Modal */
.eq-card {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.eq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(var(--primary-color-rgb), 0.2);
    border-color: var(--primary-color);
}

.modal,
#eq-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    z-index: 1001;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content .eq-card {
    border-width: 2px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: var(--glass-bg);
}

/* Ensure mini styles are overridden in modal if necessary, 
   but or we just re-render card in modal logic */
.modal-content .eq-card.mini {
    padding: 2rem;
    max-width: none;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.2);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .landing-grid {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 2rem 1.5rem;
    }
}

/* Name Search Input */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(var(--primary-color-rgb), 0.2);
    background: rgba(0, 0, 0, 0.6);
    outline: none;
}

.clear-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--primary-color);
}

/* Footer Styles */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.author-link {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.author-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 2px;
}

.author-link a:hover {
    color: #fff;
    border-bottom-style: solid;
}

/* Duplicate Name Balloon */
.name-suggestion-balloon {
    position: absolute;
    top: -10px;
    left: 100px;
    /* Offset from label */
    background: rgba(20, 25, 35, 0.95);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-size: 0.8rem;
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    z-index: 100;
    pointer-events: none;
    animation: balloonPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
    max-width: 250px;
}

.name-suggestion-balloon.active {
    display: block;
}

.name-suggestion-balloon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent;
}

@keyframes balloonPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .name-suggestion-balloon {
        left: 80px;
        top: -15px;
        max-width: 200px;
    }
}


/* 削除依頼通知バッジ */
.admin-link-container {
    position: relative;
    display: inline-block;
}

.notif-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #ff4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
    border: 2px solid var(--bg-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* 削除用モーダル拡張 */
.delete-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 2.5rem;
    text-align: left;
    max-width: 420px;
}

.delete-modal-content h3 {
    color: #ff4444;
    margin-bottom: 1rem;
    text-align: center;
}

.delete-modal-content p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.password-input-group {
    margin-bottom: 1.5rem;
}

.request-form-group {
    display: none;
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.btn-link-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 1rem;
    display: block;
    width: 100%;
    text-align: center;
}


.btn-link-sm:hover {
    color: var(--primary-color);
}

/* Property Editor Sign Toggle */
.sign-toggle-btn {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.3);
    color: #ffcc00;
    border-radius: 6px;
    height: 32px;
    min-width: 32px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-toggle-btn:hover {
    background: rgba(255, 204, 0, 0.3);
    transform: scale(1.05);
}

/* --- Simulator Styles --- */

.simulator-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}



/* Slot Cards */
.equip-slot-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.equip-slot-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.slot-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.slot-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.slot-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.reset-slot-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
    padding: 0.5rem;
}

.reset-slot-btn:hover {
    color: #ff4444;
}

.slot-content {
    padding: 1.5rem;
}

/* Step Selection */
.step-select label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-step-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.back-step-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Type Grid */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.type-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.95rem;
}

.type-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Item List */
.item-search-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    margin-bottom: 1rem;
}

.equip-slot-card .item-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.equip-slot-card .item-list::-webkit-scrollbar {
    width: 6px;
}

.equip-slot-card .item-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.equip-list-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.equip-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.equip-name {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.equip-props-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Selected Item Display */
.selected-card {
    background: rgba(212, 175, 55, 0.05);
    /* Gold tint */
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.selected-props {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.reselect-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.reselect-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Stats Display */
.sticky-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary-color);
    /* Highlight border */
    border-radius: 16px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    overflow-y: auto;
}

.sticky-card h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.stat-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Inter', monospace;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.reset-all-btn {
    width: 100%;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff8888;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.reset-all-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Mobile Layout Optimizations */
@media (max-width: 900px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }

    .stats-display-area {
        order: -1;
        /* Remove sticky on mobile to avoid blocking view with keyboard open */
        position: static;
        margin-bottom: 1rem;
    }

    .sticky-card {
        padding: 1rem;
        border-radius: 12px;
        /* Ensure it doesn't stick even if class has it */
        position: static !important;
        max-height: none;
    }

    .sticky-card h2 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.5rem;
    }

    .total-stats-list .stat-row {
        padding: 0.3rem 0.5rem;
    }

    .stat-name {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        padding-bottom: 4rem;
    }

    header {
        margin-bottom: 1rem;
        padding-top: 3.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .equip-slot-card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .slot-header {
        padding: 0.6rem 1rem;
    }

    .slot-header h3 {
        font-size: 1rem;
    }

    .slot-content {
        padding: 1rem;
    }

    .equip-list-item {
        padding: 0.6rem;
    }

    .equip-name {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .equip-props-preview {
        font-size: 0.75rem;
    }

    .item-search-input {
        padding: 0.6rem;
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .selected-card {
        padding: 0.8rem;
    }

    .selected-card h4 {
        font-size: 0.95rem;
    }

    .selected-props {
        font-size: 0.85rem;
    }
}

/* Crysta Icons (Common) */
.crysta-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 0 5px rgba(255,255,255,0.2) inset, 0 2px 4px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.crysta-icon.mini {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.crysta-icon.cat-武器 { background: radial-gradient(circle at 30% 30%, #ff8a80, #c62828); }
.crysta-icon.cat-体防具 { background: radial-gradient(circle at 30% 30%, #b2ff59, #33691e); }
.crysta-icon.cat-追加装備 { background: radial-gradient(circle at 30% 30%, #ffff8d, #f57f17); }
.crysta-icon.cat-特殊装備 { background: radial-gradient(circle at 30% 30%, #ea80fc, #6a1b9a); }
.crysta-icon.cat-ノーマル { background: radial-gradient(circle at 30% 30%, #8c9eff, #1565c0); }

.crysta-icon.enhanced.cat-武器 { background: radial-gradient(circle at 50% 50%, #111 25%, #c62828 40%, #ff8a80 80%); border: 1px solid #ff5252; }
.crysta-icon.enhanced.cat-体防具 { background: radial-gradient(circle at 50% 50%, #111 25%, #33691e 40%, #b2ff59 80%); border: 1px solid #69f0ae; }
.crysta-icon.enhanced.cat-追加装備 { background: radial-gradient(circle at 50% 50%, #111 25%, #f57f17 40%, #ffff8d 80%); border: 1px solid #ffd54f; }
.crysta-icon.enhanced.cat-特殊装備 { background: radial-gradient(circle at 50% 50%, #111 25%, #6a1b9a 40%, #ea80fc 80%); border: 1px solid #e040fb; }
.crysta-icon.enhanced.cat-ノーマル { background: radial-gradient(circle at 50% 50%, #111 25%, #1565c0 40%, #8c9eff 80%); border: 1px solid #448aff; }

.parent-nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 2px 8px;
    background: rgba(0, 242, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 255, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.parent-nav-link:hover {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--accent-color);
}