
.binder-container {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    cursor: default;
    background-color: transparent;
}

.binder-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(212, 175, 55, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.02) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
    pointer-events: none;
}

.binder-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    will-change: transform;
}


.binder-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 150px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    
    overflow: visible;
    
    container-type: size;
    user-select: none;
    -webkit-user-select: none;
    min-width: 150px;
    min-height: 100px;
}


.card-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 11;
    
    opacity: 0;
    transition: opacity 0.2s;
    background:
        linear-gradient(135deg, transparent 0%, transparent 45%, var(--accent-brass, #d4af37) 45%, var(--accent-brass, #d4af37) 55%, transparent 55%, transparent 65%, var(--accent-brass, #d4af37) 65%, var(--accent-brass, #d4af37) 75%, transparent 75%);
}

.binder-card:hover .card-resize-handle {
    opacity: 0.7;
}


.is-resizing,
.is-resizing * {
    cursor: nwse-resize !important;
    user-select: none;
    -webkit-user-select: none;
}


.binder-card::before,
.binder-card::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #555 20%, #222 80%);
    border-radius: 50%;
    border: 1px solid #111;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
    z-index: 5;
    pointer-events: none;
}

.binder-card::before {
    top: 6px;
    right: 6px;
}

.binder-card::after {
    bottom: 6px;
    right: 6px;
}


.card-indicator {
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 4px;
    background: #222;
    box-shadow: inset 0 0 2px #000;
    transition: background 0.5s ease, box-shadow 0.5s ease;
    z-index: 5;
}

.binder-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.binder-card.selected {
    border-color: var(--accent-brass);
    box-shadow: 0 0 0 1px var(--accent-brass), 0 8px 25px rgba(0, 0, 0, 0.8);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    z-index: 2;
    position: relative;
    padding-left: 12px;
    
}

.card-title {
    font-weight: 600;
    flex: 1;
    word-break: break-word;
    line-height: 1.3;
    text-shadow: 1px 1px 2px #000;
}

.binder-card .card-tags {
    margin-top: auto;
    z-index: 2;
    position: relative;
    padding-left: 12px;
}

.card-status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent-brass);
    margin-left: 8px;
    white-space: nowrap;
    border: 1px solid var(--accent-copper);
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: inset 0 0 5px rgba(184, 115, 51, 0.3);
}


.binder-card:hover .card-indicator {
    background: var(--indicator-color, #ffaa00);
    box-shadow: 0 0 10px var(--indicator-color, #ffaa00);
}


.binder-card.is-linked::before,
.binder-card.is-linked::after {
    background: radial-gradient(circle, #ffb380 20%, #b87333 80%);
    border-color: #5c3a21;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 0 8px rgba(184, 115, 51, 0.8);
}

.binder-card.dragging {
    opacity: 0.9;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    transform: scale(1.02) rotate(2deg);
    
    cursor: grabbing;
    z-index: 99999 !important;
}

.portal-card {
    border-color: #4a90e2;
    background: linear-gradient(135deg, rgba(20, 22, 20, 0.9) 0%, rgba(30, 40, 50, 0.9) 100%);
    height: auto;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.portal-card .card-indicator {
    --indicator-color: #4a90e2;
    background: #1a365d;
}


.portal-card.portal-highlight {
    box-shadow: 0 0 40px rgba(74, 144, 226, 0.8), inset 0 0 20px rgba(74, 144, 226, 0.5) !important;
    z-index: 99990 !important;
}


.card-sucking {
    transition: transform 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53), opacity 0.6s ease-in !important;
    pointer-events: none !important;
    z-index: 99999 !important;
}


.binder-zone {
    position: absolute;
    border: 1px solid rgba(212, 175, 55, 0.15);
    
    border-radius: 0;
    
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.02) 0%, transparent 100%);
    z-index: 0;
    resize: both;
    overflow: hidden;
    min-width: 250px;
    min-height: 220px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}


.binder-zone::before,
.binder-zone::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    pointer-events: none;
}

.binder-zone::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.binder-zone::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.binder-zone-header {
    padding: 10px 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-brass);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(10, 12, 10, 0.5);
    user-select: none;
    font-family: 'Roboto Slab', serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: grab;
}

.binder-zone-header:active {
    cursor: grabbing;
}

.zone-todo {
    border-color: rgba(123, 176, 255, 0.3);
}

.zone-doing {
    border-color: rgba(212, 175, 55, 0.4);
}

.zone-done {
    border-color: rgba(76, 175, 80, 0.3);
}


.binder-zone.zone-highlight {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.1);
}


.zone-overload-pulse {
    animation: overheat-pulse 2s infinite alternate;
}

@keyframes overheat-pulse {
    0% {
        border-color: rgba(255, 69, 0, 0.4);
        box-shadow: inset 0 0 10px rgba(255, 69, 0, 0.1), 0 0 10px rgba(255, 69, 0, 0.1);
        background: linear-gradient(to bottom, rgba(255, 69, 0, 0.02) 0%, transparent 100%);
    }

    100% {
        border-color: rgba(255, 69, 0, 1);
        box-shadow: inset 0 0 50px rgba(255, 69, 0, 0.4), 0 0 20px rgba(255, 69, 0, 0.6);
        background: linear-gradient(to bottom, rgba(255, 69, 0, 0.1) 0%, transparent 100%);
    }
}


.hazard-tape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 999;
    background: #ff2200;
    pointer-events: none;
    animation: hazard-glow 2s infinite alternate;
    overflow: hidden;
}


.hazard-tape::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 25px;
    height: 100%;
    background: #2a0000;
    
    box-shadow: 0 0 10px #4a0000, 0 0 20px #1a0000;
    animation: tape-scanner 3s linear infinite;
    border-radius: 50%;
}

@keyframes hazard-glow {
    0% {
        background: #8b0000;
        box-shadow: 0 0 10px rgba(139, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.8);
    }

    100% {
        background: #ff4500;
        box-shadow: 0 0 30px rgba(255, 69, 0, 1), 0 0 15px rgba(255, 0, 0, 0.8);
    }
}

@keyframes tape-scanner {
    0% {
        transform: translateX(100vw);
    }

    20% {
        transform: translateX(-30px);
    }

    
    100% {
        transform: translateX(-30px);
    }

    
}

.is-selecting,
.is-panning {
    user-select: none;
    -webkit-user-select: none;
}





.header-binder-btn {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.binder-dashboard-modal {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.binder-dashboard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.binder-dashboard-title {
    margin: 0;
    font-size: 1.4rem;
    color: var(--accent-brass);
    letter-spacing: 1px;
    flex-shrink: 0;
}

.binder-dashboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}


.binder-dashboard-search {
    flex: 1;
    min-width: 160px;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 12, 10, 0.8);
    color: var(--accent-brass);
    font-family: 'Inter', sans-serif;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.binder-dashboard-search::placeholder {
    color: rgba(212, 175, 55, 0.45);
}

.binder-dashboard-search:focus {
    background: rgba(15, 18, 15, 0.95);
    border-color: var(--accent-copper);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(184, 115, 51, 0.35);
}

.binder-dashboard-sort {
    flex-shrink: 0;
    min-width: 170px;
    font-size: 0.85rem;
    padding: 0.5rem 2rem 0.5rem 0.85rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background-color: rgba(10, 12, 10, 0.8);
    color: var(--accent-brass);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.binder-dashboard-sort:hover,
.binder-dashboard-sort:focus {
    background-color: rgba(15, 18, 15, 0.95);
    border-color: var(--accent-copper);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(184, 115, 51, 0.35);
}

.binder-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.binder-dashboard-grid:empty::after {
    content: 'バインダーがありません';
    color: #aaa;
    font-size: 0.9rem;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
}


.dashboard-binder-card {
    position: relative;
    height: 110px;
    cursor: pointer;
    border-radius: 4px;
    overflow: visible;
    transition: transform 0.15s;
}

.dashboard-binder-card:hover {
    transform: translateY(-2px);
}


.dashboard-binder-card:hover .sp-vault-face {
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.95),
        0 16px 32px rgba(0, 0, 0, 0.9),
        0 0 0 1.5px rgba(85, 105, 130, 0.75),
        0 0 0 3px rgba(22, 28, 36, 0.9),
        0 0 22px rgba(74, 144, 226, 0.12);
}

.dashboard-binder-card:hover .sp-vault-keyhole-area svg {
    filter:
        drop-shadow(0 0 8px rgba(160, 195, 235, 0.7)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
}


.dashboard-binder-card.is-current .sp-vault-face {
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.95),
        0 10px 24px rgba(0, 0, 0, 0.85),
        0 0 0 1.5px rgba(184, 115, 51, 0.7),
        0 0 0 3px rgba(22, 28, 36, 0.9),
        0 0 18px rgba(184, 115, 51, 0.25);
}


.dashboard-binder-card .card-led-indicator {
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: #1a1a1a;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.8);
    z-index: 20;
    pointer-events: none;
}

.dashboard-binder-card:hover .card-led-indicator {
    background: var(--led-green);
    box-shadow:
        0 0 6px var(--led-green-glow),
        0 0 14px var(--led-green-glow),
        inset 0 0 4px rgba(255, 255, 255, 0.3);
}

.dashboard-binder-card.is-current .card-led-indicator {
    background: var(--accent-copper);
    box-shadow:
        0 0 6px rgba(184, 115, 51, 0.8),
        0 0 14px rgba(184, 115, 51, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.3);
}


.dashboard-binder-card .sp-vault-plate {
    height: auto;
    padding: 4px 12px;
}

.dashboard-binder-card .sp-vault-plate-text {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}


.dashboard-vault-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 2px 0;
    min-height: 0;
}

.dashboard-vault-desc-viewport {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.dashboard-vault-desc {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    will-change: transform;
    margin: 0;
}

.dashboard-vault-desc.is-scrolling {
    animation: dashboardDescScrollY 9s linear infinite;
}

@keyframes dashboardDescScrollY {
    0% {
        transform: translateY(var(--ticker-start));
        opacity: 1;
    }

    8% {
        transform: translateY(var(--ticker-start));
        opacity: 1;
    }

    
    83% {
        transform: translateY(var(--ticker-end));
        opacity: 1;
    }

    
    91% {
        transform: translateY(var(--ticker-end));
        opacity: 0;
    }

    
    91.5% {
        transform: translateY(var(--ticker-start));
        opacity: 0;
    }

    
    100% {
        transform: translateY(var(--ticker-start));
        opacity: 1;
    }

    
}

.dashboard-vault-meta {
    font-size: 0.7rem;
    color: var(--accent-copper);
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 4px;
    margin-top: 4px;
    flex-shrink: 0;
}


.dashboard-binder-card.is-hidden {
    display: none;
}


.dashboard-pin-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 15;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}


.dashboard-pin-btn:hover::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    border: 1px dashed rgba(229, 208, 112, 0.45);
}


.dashboard-binder-card.is-pinned .dashboard-pin-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 1%, 64% 5%, 75% 2%, 85% 12%, 95% 18%,
            99% 32%, 92% 42%, 99% 55%, 90% 65%, 95% 78%,
            82% 84%, 72% 96%, 60% 90%, 48% 99%,
            36% 91%, 24% 97%, 12% 88%, 5% 76%,
            10% 63%, 1% 52%, 8% 40%, 2% 27%,
            14% 18%, 25% 8%, 38% 6%);
    background: radial-gradient(circle at 36% 28%, #c0453a 0%, #8a1f18 45%, #5c0f0a 80%, #3d0805 100%);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.75),
        inset 0 1px 1px rgba(255, 150, 130, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.5);
}

.dashboard-binder-card.is-pinned .dashboard-pin-btn:hover::before {
    filter: brightness(1.12);
}

.dashboard-pin-btn:active {
    transform: scale(0.92);
}


.zone-bg-gear {
    position: absolute;
    right: -200px;
    bottom: -200px;
    width: 440px;
    height: 440px;
    opacity: 0.15;
    
    pointer-events: none;
    
    z-index: -1;
    
}

.zone-bg-gear svg {
    width: 100%;
    height: 100%;
    
    color: var(--brass-main, #b3923b); 
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
    
    animation: slow-spin 30s linear infinite;
    animation-play-state: paused;
}


.binder-zone:hover .zone-bg-gear svg {
    animation-play-state: running;
}



body.gravity-locked .binder-card,
body.gravity-locked .binder-zone,
body.gravity-locked .card-resize-handle {
    pointer-events: none;
}


body.gravity-locked #ctx-menu-canvas > *:not(#ctx-undo-arrange) {
    display: none !important;
}

@keyframes slow-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}