/* =============================================================================
   GUANNY.XYZ // WEB3 TREE HOLE & PORTAL ENGINE STYLES (web3-portals.css)
   ============================================================================= */

/* 1. Drawer Navigation Accordion & Sub-items */
.drawer-nav-accordion {
    display: flex;
    flex-direction: column;
}

.drawer-accordion-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-accordion-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 2px;
    background: rgba(255, 42, 27, 0.15);
    border: 1px solid rgba(255, 42, 27, 0.4);
    color: var(--color-accent-red);
    margin-left: auto;
    margin-right: 8px;
    white-space: nowrap;
}

.nav-accordion-arrow {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-nav-accordion.expanded .nav-accordion-arrow {
    transform: rotate(180deg);
    color: var(--color-accent-red);
}

.drawer-subnav-list {
    list-style: none;
    margin: 6px 0 0 10px;
    padding: 6px 0 6px 12px;
    border-left: 2px dashed rgba(255, 42, 27, 0.35);
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: all 0.3s ease;
}

.drawer-nav-accordion:not(.expanded) .drawer-subnav-list {
    display: none;
}

.drawer-subnav-item {
    position: relative;
}

.drawer-subnav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    text-decoration: none;
    color: #FFFFFF;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.drawer-subnav-link:hover {
    background: rgba(255, 42, 27, 0.12);
    border-color: rgba(255, 42, 27, 0.45);
    border-left: 2px solid var(--color-accent-red);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(255, 42, 27, 0.2);
}

.drawer-subnav-link.active {
    background: rgba(255, 42, 27, 0.18);
    border-color: var(--color-accent-red);
    border-left: 3px solid var(--color-accent-red);
}

.subnav-indicator {
    font-family: var(--font-mono);
    color: var(--color-accent-red);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.subnav-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.subnav-title {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.drawer-subnav-link:hover .subnav-title {
    color: var(--color-accent-red);
}

.subnav-desc {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subnav-gate-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 42, 27, 0.45);
    color: var(--color-accent-red);
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.subnav-hub-link {
    background: rgba(255, 42, 27, 0.08);
    border-color: rgba(255, 42, 27, 0.3);
}

.subnav-hub-arrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--color-accent-red);
    flex-shrink: 0;
}

/* 2. Web3 Token Gate Shield Overlay */
.gate-screen {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    z-index: 10;
    background: radial-gradient(circle at 50% 40%, rgba(255, 42, 27, 0.06) 0%, transparent 70%);
}

.gate-screen.unlocked {
    display: none;
}

.gate-shield-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid var(--hud-border);
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(255, 42, 27, 0.15);
    padding: 36px 32px;
    text-align: center;
    overflow: hidden;
}

/* Scan laser animation across gate card */
.gate-shield-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent-red), #FFF, var(--color-accent-red), transparent);
    box-shadow: 0 0 15px var(--color-accent-red);
    opacity: 0.8;
    animation: gateScanLine 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gateScanLine {
    0% { transform: translateY(0); }
    50% { transform: translateY(520px); }
    100% { transform: translateY(0); }
}

.gate-hud-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-accent-red);
    pointer-events: none;
}
.gate-c-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.gate-c-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.gate-c-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.gate-c-br { bottom: 0; right: 0; border-left: none; border-top: none; }

.gate-lock-icon-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gate-lock-ring {
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(255, 42, 27, 0.5);
    border-radius: 50%;
    animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gate-lock-ring-inner {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(255, 42, 27, 0.25);
    border-top-color: var(--color-accent-red);
    border-radius: 50%;
    animation: spinSlowReverse 6s linear infinite;
}

@keyframes spinSlowReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.gate-lock-glyph {
    font-size: 2rem;
    color: var(--color-accent-red);
    text-shadow: 0 0 20px var(--color-accent-red-glow);
    z-index: 2;
}

.gate-protocol-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-accent-red);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.gate-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.gate-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* NFT Specification Gated Box */
.gate-nft-spec-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 42, 27, 0.35);
    border-radius: 4px;
    padding: 18px 20px;
    text-align: left;
    margin-bottom: 24px;
    position: relative;
}

.gate-nft-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--color-accent-red);
    background: rgba(255, 42, 27, 0.12);
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 10px;
}

.gate-nft-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gate-spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gate-spec-label {
    color: var(--text-secondary);
}

.gate-spec-val {
    color: var(--text-primary);
    font-weight: 700;
}

.gate-contract-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.gate-contract-addr {
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-accent-red);
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gate-btn-icon {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    transition: all 0.2s;
}

.gate-btn-icon:hover {
    border-color: var(--color-accent-red);
    color: var(--color-accent-red);
    background: rgba(255, 42, 27, 0.1);
}

/* Multi-Contract Gated List */
.gate-contracts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.gate-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 12px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.gate-contracts-list::-webkit-scrollbar {
    width: 4px;
}
.gate-contracts-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.gate-contracts-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.gate-contract-item {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.gate-contract-item:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
}

.gate-contract-item.verified {
    border-color: #00E676 !important;
    background: rgba(0, 230, 118, 0.08) !important;
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.2);
}

.contract-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.contract-item-name {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chain-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.chain-badge.chain-eth {
    background: rgba(98, 126, 234, 0.18);
    border: 1px solid rgba(98, 126, 234, 0.5);
    color: #8C9EFF;
}

.chain-badge.chain-polygon {
    background: rgba(130, 71, 229, 0.22);
    border: 1px solid rgba(130, 71, 229, 0.55);
    color: #B388FF;
}

.chain-badge.chain-custom {
    background: rgba(255, 171, 0, 0.2);
    border: 1px solid rgba(255, 171, 0, 0.5);
    color: #FFD54F;
}

.standard-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: #9A9AA4;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 2px;
    flex-shrink: 0;
}

.contract-item-bal {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: #8E8E9A;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 2px;
    flex-shrink: 0;
}

.contract-item-bal.has-token {
    color: #00E676;
    background: rgba(0, 230, 118, 0.18);
    border: 1px solid rgba(0, 230, 118, 0.5);
}

.contract-item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contract-item-addr {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.contract-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Tree Hole Hub Contract Pills */
.portal-contracts-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.portal-contract-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.portal-contract-pill:hover {
    border-color: var(--portal-accent, var(--color-accent-red));
    color: var(--portal-accent, var(--color-accent-red));
    background: rgba(255, 255, 255, 0.05);
}

/* Status Diagnostic Log */
.gate-status-panel {
    background: rgba(255, 42, 27, 0.06);
    border-left: 3px solid var(--color-accent-red);
    padding: 10px 14px;
    text-align: left;
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

.gate-status-code {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-accent-red);
    letter-spacing: 0.12em;
    margin-bottom: 2px;
}

.gate-status-desc {
    font-size: 0.8rem;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

/* Gate Actions */
.gate-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gate-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--color-accent-red);
    color: #FFFFFF;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    box-shadow: 0 4px 20px var(--color-accent-red-glow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gate-btn-primary:hover {
    background: #ff4739;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--color-accent-red);
}

.gate-action-subrow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gate-btn-secondary {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--color-glass-border);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
    transition: all 0.2s;
    text-decoration: none;
}

.gate-btn-secondary:hover {
    border-color: var(--color-accent-red);
    color: var(--color-accent-red);
    background: rgba(255, 42, 27, 0.08);
    transform: translateY(-2px);
}

.btn-wallet-disconnect {
    border-color: rgba(255, 68, 68, 0.4);
    color: #FF5252;
}

.btn-wallet-disconnect:hover {
    border-color: #FF5252;
    color: #FFFFFF;
    background: rgba(255, 82, 82, 0.2);
    box-shadow: 0 0 14px rgba(255, 82, 82, 0.35);
}

/* 3. Verified Floating HUD Bar (Appears when unlocked) */
.gate-verified-hud {
    position: fixed;
    top: 54px;
    right: 28px;
    z-index: 85;
    background: rgba(14, 14, 18, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--color-accent-red);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 42, 27, 0.25);
    border-radius: 4px;
    padding: 6px 14px;
    display: none;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}

.gate-verified-hud.active {
    display: flex;
}

.hud-verified-dot {
    width: 8px;
    height: 8px;
    background: #00FF88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00FF88;
    animation: blinkDot 1.6s infinite;
}

.hud-verified-text {
    color: #FFFFFF;
    font-weight: 700;
}

.hud-verified-lock-btn {
    padding: 3px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    transition: all 0.2s;
}

.hud-verified-lock-btn:hover {
    border-color: var(--color-accent-red);
    color: var(--color-accent-red);
}

/* 4. Vault Content States */
.hidden-vault {
    display: none !important;
}

.revealed-vault {
    display: block !important;
    animation: vaultReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes vaultReveal {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); filter: blur(10px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* 5. Portal Hub Styling (dist/treehole/index.html) */
.treehole-hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 24px 60px;
}

.treehole-header {
    text-align: center;
    margin-bottom: 48px;
}

.treehole-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: var(--color-accent-red);
    margin-bottom: 8px;
    display: inline-block;
}

.treehole-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.treehole-lead {
    max-width: 680px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.portals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-bottom: 48px;
}

.portal-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--color-glass-border);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
}

.portal-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--portal-accent, var(--color-accent-red));
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-card:hover {
    transform: translateY(-6px);
    border-color: var(--portal-accent, var(--color-accent-red));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 25px rgba(255, 42, 27, 0.2);
}

.portal-card:hover::before {
    width: 8px;
}

.portal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.portal-num {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--portal-accent, var(--color-accent-red));
}

.portal-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 3px 8px;
    background: rgba(255, 42, 27, 0.12);
    border: 1px solid rgba(255, 42, 27, 0.4);
    color: var(--portal-accent, var(--color-accent-red));
    border-radius: 2px;
}

.portal-card-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.portal-card-zh {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.portal-card-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex: 1;
}

.portal-nft-req {
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 14px;
    border-radius: 4px;
    border-left: 3px solid var(--portal-accent, var(--color-accent-red));
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

.portal-nft-req.holding-verified {
    background: rgba(0, 230, 118, 0.08) !important;
    border-left-color: #00E676 !important;
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.18);
}

.portal-req-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-req-label {
    color: var(--text-secondary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.portal-req-val {
    color: var(--text-primary);
    font-weight: 700;
}

/* NFT Media Display inside portal-nft-req */
.portal-nft-media-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(14, 14, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 8px 10px;
    transition: all 0.3s ease;
}

.portal-nft-media-box.verified {
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.06);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}

.portal-nft-thumb {
    position: relative;
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #0A0A0E;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.portal-nft-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.portal-nft-media-box:hover .portal-nft-thumb img {
    transform: scale(1.08);
}

.thumb-lock-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    background: rgba(0, 0, 0, 0.85);
    color: #9A9AA4;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.thumb-lock-badge.verified {
    background: rgba(0, 230, 118, 0.95);
    color: #0A0A0E;
    font-weight: 900;
}

.portal-nft-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.portal-nft-title {
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-nft-status-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: #9A9AA4;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-nft-status-tag.verified {
    color: #00E676;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.portal-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--portal-accent, var(--color-accent-red));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

/* =============================================================================
   6.5 Multi-NFT Gallery Grid (When user holds multiple NFTs)
   ============================================================================= */
.portal-nft-gallery {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    background: rgba(10, 10, 14, 0.85);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 0 15px rgba(0, 230, 118, 0.06);
    animation: fadeInGallery 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-nft-gallery.active {
    display: flex;
}

@keyframes fadeInGallery {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-header-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: #00E676;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-header-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    background: rgba(0, 230, 118, 0.15);
    color: #00E676;
    border: 1px solid rgba(0, 230, 118, 0.4);
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: 800;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}

.gallery-grid::-webkit-scrollbar {
    width: 4px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 230, 118, 0.45);
    border-radius: 2px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #00E676;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 5px;
    text-decoration: none;
    transition: all 0.22s ease;
    cursor: pointer;
}

.gallery-item:hover {
    border-color: #00E676;
    background: rgba(0, 230, 118, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.25);
}

.gallery-item-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    overflow: hidden;
    background: #0A0A0E;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.gallery-item:hover .gallery-item-thumb img {
    transform: scale(1.08);
}

.gallery-item-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.88);
    color: #00E676;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid rgba(0, 230, 118, 0.4);
    line-height: 1.1;
    backdrop-filter: blur(2px);
}

.gallery-item-name {
    font-family: var(--font-display);
    font-size: 0.64rem;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.gallery-item:hover .gallery-item-name {
    color: #00E676;
}

/* Vault Holder Inventory Panel (Inside Unlocked Secret Vault) */
.vault-inventory-panel {
    background: rgba(14, 14, 18, 0.88);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: 4px;
    padding: 22px 24px;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 25px rgba(0, 230, 118, 0.12);
}

.vault-inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vault-inventory-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #00E676;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vault-inventory-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 2px;
    background: rgba(0, 230, 118, 0.15);
    color: #00E676;
    border: 1px solid #00E676;
}

.vault-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 2px;
}

.vault-inventory-grid .gallery-item {
    padding: 8px;
}

.vault-inventory-grid .gallery-item-name {
    font-size: 0.72rem;
    margin-top: 2px;
}

/* 7. Project Specific Vault Layouts */
.vault-header-hero {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.vault-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--color-accent-red);
    padding: 4px 12px;
    background: rgba(255, 42, 27, 0.1);
    border: 1px solid rgba(255, 42, 27, 0.35);
    border-radius: 2px;
    margin-bottom: 12px;
}

.vault-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 12px;
}

.vault-tagline {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

/* Grid & Cards inside Vault */
.relics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.relic-card {
    background: var(--card-bg);
    border: 1px solid var(--color-glass-border);
    padding: 24px;
    border-radius: 2px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.25s ease;
}

.relic-card:hover {
    border-color: var(--color-accent-red);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 42, 27, 0.15);
}

.relic-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--color-accent-red);
    letter-spacing: 0.15em;
    margin-bottom: 6px;
}

.relic-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.relic-item-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-accent-red);
    margin-bottom: 12px;
    font-weight: 700;
}

.relic-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Interactive Canvas / Visualizer Container */
.interactive-viewport-box {
    position: relative;
    width: 100%;
    height: 440px;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid var(--color-glass-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 40px;
}

.viewport-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viewport-controls-bar {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 14, 18, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 2px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .gate-shield-card {
        padding: 28px 20px;
    }
    .gate-title {
        font-size: 1.7rem;
    }
    .gate-verified-hud {
        right: 14px;
        top: 48px;
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    .portals-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   Planned-feature marker ("規劃中") - shared status tag for unfinished items
   ========================================================================== */
.planning-tag {
    display: inline-block;
    font-family: var(--font-mono, 'Rajdhani', monospace);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.5;
    padding: 1px 7px;
    margin-left: 6px;
    border: 1px dashed rgba(255, 157, 59, 0.75);
    border-radius: 2px;
    color: #ffb15c;
    background: rgba(255, 122, 0, 0.1);
    vertical-align: middle;
    white-space: nowrap;
}

body:not(.theme-obsidian) .planning-tag {
    color: #a84a00;
    border-color: rgba(168, 74, 0, 0.6);
    background: rgba(255, 122, 0, 0.12);
}
/* ==========================================================================
   Source / asset credit notes (third-party material attribution)
   ========================================================================== */
.source-note {
    margin: 10px 0 0;
    padding: 8px 12px;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary, #9a9aa4);
    border-left: 2px solid rgba(255, 157, 59, 0.6);
    background: rgba(255, 255, 255, 0.04);
}

.asset-credit {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 0.74rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    border: 1px dashed rgba(255, 157, 59, 0.45);
    background: rgba(255, 255, 255, 0.03);
}

.asset-credit strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-mono, 'Rajdhani', monospace);
    letter-spacing: 0.1em;
    color: #ffb15c;
}

.asset-credit p { margin: 0 0 4px; }

.asset-credit a {
    color: #ffb15c;
    text-decoration: underline;
}
/* ==========================================================================
   Accessibility & readability overrides (global; loaded by all main pages)
   - visible keyboard focus, reduced-motion, hit-target size, contrast, min font
   ========================================================================== */

/* 1. Visible keyboard focus (clip-path'd controls would crop the outline) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid #FF2A1B !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.85), 0 0 14px 4px rgba(255, 42, 27, 0.55) !important;
}

.enter-btn:focus-visible, .menu-btn:focus-visible, .lang-toggle-btn:focus-visible,
.hint-chip-btn:focus-visible, .enter-linktree-btn:focus-visible, .enter-x-btn:focus-visible,
.enter-return-btn:focus-visible, .inspect-opt-btn:focus-visible, .inspect-act-btn:focus-visible,
.reassemble-btn:focus-visible, .drawer-lang-btn:focus-visible, .gate-btn-primary:focus-visible,
.gate-btn-secondary:focus-visible, .gate-btn-icon:focus-visible, .enter-manifesto-card:focus-visible {
    clip-path: none !important;
}

/* 2. Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* 3. Hit-target size (WCAG 2.2: >= 24px; touch devices >= 44px) */
.icon-btn { width: 36px !important; height: 36px !important; }
.menu-btn { height: 36px !important; }
.drawer-lang-btn { min-height: 32px !important; padding: 0 12px !important; }
.inspect-close-btn { min-width: 36px; min-height: 36px; }
.close-btn { width: 44px !important; height: 44px !important; }
@media (pointer: coarse) {
    .icon-btn, .menu-btn, .lang-toggle-btn, .inspect-close-btn, .drawer-lang-btn { min-width: 44px !important; min-height: 44px !important; }
    .icon-btn { width: 44px !important; height: 44px !important; }
}

/* 4. Contrast: replace low-alpha greys with theme-aware secondary text */
html body .hud-data-label { color: var(--text-secondary) !important; font-size: 0.75rem !important; }
html body .hud-data-label:hover { color: var(--color-accent-red) !important; }
html body #hud-status-text, html body #hud-theme-text, html body .hud-energy-val { color: var(--text-secondary) !important; }
html body .enter-hint { color: var(--text-secondary) !important; font-size: 0.75rem !important; }
html body:not(.theme-obsidian) .hero-meta-row { color: var(--text-secondary) !important; }
html body:not(.theme-obsidian) .hero-meta-row::before,
html body:not(.theme-obsidian) .hero-meta-row::after { background: rgba(17, 17, 17, 0.25) !important; }
html body .drawer-title,
html body .drawer-copy,
html body .social-link,
html body .drawer-nav-link .nav-stub-tag,
html body .drawer-nav-link .nav-active-tag { color: rgba(255, 255, 255, 0.72) !important; }
html body .drawer-copy { font-size: 0.75rem !important; }
html body .drawer-lang-btn { color: rgba(255, 255, 255, 0.85) !important; font-size: 0.75rem !important; }
html body .drawer-nav-link .nav-stub-tag,
html body .drawer-nav-link .nav-active-tag,
html body .hud-energy-hint,
html body .cursor-coords { font-size: 0.75rem !important; }

/* 5. Allow selecting / copying informational text (addresses, descriptions) */
.enter-card-desc, .portal-card-desc, .relic-desc, .card-description, .card-content-body p,
.about-disclaimer-clean, .source-note, .asset-credit, .manifesto-card-sub,
code, pre, [class*="addr"] {
    -webkit-user-select: text !important;
    user-select: text !important;
}