/* ============================================
   DM Chat — Nav Icon (unchanged, stays white)
   ============================================ */

.dm-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: opacity 0.3s ease;
}

.dm-nav-btn:hover {
    opacity: 0.6;
}

.dm-nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.55;
    transition: opacity 0.3s ease;
}

.dm-nav-btn:hover .dm-nav-icon {
    opacity: 0.85;
}

@keyframes dmNudge {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(8deg); }
    30% { transform: rotate(-6deg); }
    45% { transform: rotate(4deg); }
    60% { transform: rotate(-2deg); }
    75% { transform: rotate(1deg); }
}

.dm-nav-icon.nudge {
    animation: dmNudge 0.6s ease 1.2s both;
}

.dm-nav-badge {
    position: absolute;
    top: 0;
    right: -2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00ff41;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 0 6px #00ff41;
}

.dm-nav-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   DM Chat — Full-Screen Matrix Page
   ============================================ */

.dm-page {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #000000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
}

.dm-page.open {
    opacity: 1;
    pointer-events: auto;
}

/* Matrix rain canvas */
.dm-matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.35;
}

/* Page header */

.dm-page-header {
    height: var(--header-height, 64px);
    padding: 0 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.dm-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.dm-back-btn:hover {
    opacity: 0.6;
}

.dm-back-btn svg {
    width: 20px;
    height: 20px;
    stroke: #00ff41;
    stroke-width: 1.5;
    fill: none;
    filter: drop-shadow(0 0 3px rgba(0, 255, 65, 0.4));
}

.dm-page-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 255, 65, 0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Page body */

.dm-page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Nickname screen */

.dm-nickname-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
    gap: 28px;
}

.dm-nickname-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: rgba(0, 255, 65, 0.45);
    line-height: 1.7;
    text-align: center;
    max-width: 400px;
    letter-spacing: 0.03em;
}

.dm-nickname-error {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #ff4040;
    letter-spacing: 0.03em;
    min-height: 16px;
    text-align: center;
}

.dm-nickname-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 380px;
}

.dm-nickname-input {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    color: #00ff41;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    caret-color: #00ff41;
}

.dm-nickname-input::placeholder {
    color: rgba(0, 255, 65, 0.18);
}

.dm-nickname-input:focus {
    border-color: rgba(0, 255, 65, 0.5);
}

.dm-nickname-submit {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 2px;
    color: rgba(0, 255, 65, 0.6);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-nickname-submit:hover {
    border-color: rgba(0, 255, 65, 0.6);
    color: #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.15);
}

.dm-nickname-submit:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Messages */

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,65,0.1) transparent;
}

.dm-messages::-webkit-scrollbar {
    width: 3px;
}

.dm-messages::-webkit-scrollbar-track {
    background: transparent;
}

.dm-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.12);
    border-radius: 2px;
}

.dm-msg {
    max-width: 560px;
    padding: 12px 16px;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
    animation: dmMsgIn 0.3s ease;
    letter-spacing: 0.02em;
}

@keyframes dmMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dm-msg--visitor {
    align-self: flex-end;
    background: rgba(0, 255, 65, 0.06);
    color: rgba(0, 255, 65, 0.85);
    border: 1px solid rgba(0, 255, 65, 0.1);
}

.dm-msg--admin {
    align-self: flex-start;
    background: rgba(0, 255, 65, 0.03);
    color: rgba(0, 255, 65, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.06);
}

.dm-msg-time {
    font-size: 10px;
    color: rgba(0, 255, 65, 0.2);
    margin-top: 4px;
    letter-spacing: 0.05em;
}

.dm-msg--visitor .dm-msg-time {
    text-align: right;
}

.dm-empty-hint {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 255, 65, 0.15);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.05em;
}

/* Input area */

.dm-input-area,
.dm-input-row {
    padding: 16px 60px 32px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    border-top: 1px solid rgba(0, 255, 65, 0.08);
    position: relative;
    z-index: 2;
}

.dm-input {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    color: #00ff41;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 42px;
    transition: border-color 0.3s;
    caret-color: #00ff41;
    letter-spacing: 0.02em;
}

.dm-input::placeholder {
    color: rgba(0, 255, 65, 0.16);
    font-size: 13px;
}

.dm-input:focus {
    border-color: rgba(0, 255, 65, 0.4);
}

.dm-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 2px;
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 4px;
}

.dm-send-btn:hover {
    border-color: rgba(0, 255, 65, 0.5);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.12);
}

.dm-send-btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.dm-send-btn svg {
    width: 14px;
    height: 14px;
    stroke: rgba(0, 255, 65, 0.5);
    stroke-width: 1.5;
    fill: none;
}

/* Responsive */

@media (max-width: 768px) {
    .dm-page-header {
        padding: 0 20px;
    }

    .dm-messages {
        padding: 20px;
    }

    .dm-input-area,
    .dm-input-row {
        padding: 14px 20px 24px;
    }

    .dm-nickname-screen {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .dm-nav-btn {
        margin-left: 12px;
    }

    .dm-nav-icon {
        width: 16px;
        height: 16px;
    }
}
