/* ==========================================================================
   3D ASCII CHRISTMAS TREE - FULLSCREEN CURTAIN OVERLAY (v4.0 - 100% PURE ASCII)
   - Pure ASCII Art 2027 Countdown Header (No CSS rounded boxes or AI-like pills)
   - Pure ASCII Terminal Command Trigger ([ * KAR KURESINI SALLA * ])
   - In-Scene 3D/2.5D Interactive ASCII Music Box placed behind the left of the tree
   ========================================================================== */

body.christmas-mode {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Hide underlying portfolio elements completely when curtain is active */
body.christmas-mode > .navbar,
body.christmas-mode > .main-container,
body.christmas-mode > .footer,
body.christmas-mode > #tron-canvas,
body.christmas-mode > .cyber-glow-bg,
body.christmas-mode > #matrix-canvas {
    visibility: hidden !important;
    pointer-events: none !important;
}

#christmas-curtain-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    background-color: #030408;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
}

#christmas-curtain-overlay.curtain-hidden {
    display: none !important;
}

#ascii-tree-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
    z-index: 1;
}

#ascii-tree-canvas:active {
    cursor: grabbing;
}

#ascii-tree-canvas.mbox-hover {
    cursor: pointer !important;
}

/* ==========================================================================
   1. PURE ASCII ART COUNTDOWN HEADER (Zero CSS boxes/borders/emojis)
   ========================================================================== */
.ascii-hero-header {
    position: relative;
    z-index: 10;
    margin-top: calc(env(safe-area-inset-top, 0px) + 8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
    max-width: 98vw;
}

.ascii-countdown-pre {
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 9.5px;
    line-height: 1.05;
    font-weight: 700;
    color: #fde047;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.35), 0 1px 3px rgba(0, 0, 0, 0.95);
    white-space: pre;
    text-align: center;
    letter-spacing: 0;
}

.ascii-command-row {
    margin-top: 3px;
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.ascii-cmd-btn {
    background: transparent;
    border: none;
    padding: 2px 8px;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: #93c5fd;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4), 0 1px 3px rgba(0, 0, 0, 0.95);
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.ascii-cmd-btn.ascii-cmd-raffle {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.45), 0 1px 3px rgba(0, 0, 0, 0.95);
}

.ascii-cmd-btn.ascii-cmd-admin {
    color: #fde047;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5), 0 1px 3px rgba(0, 0, 0, 0.95);
}

.ascii-cmd-btn:hover {
    color: #fef08a;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.75);
}

.ascii-cmd-btn:active {
    color: #4ade80;
}

/* ==========================================================================
   2. PURE ASCII SECRET SANTA / MUHURLU ZARF TERMINAL MODAL
   ========================================================================== */
#christmas-ui-slot {
    position: relative;
    z-index: 25;
    pointer-events: auto;
}

.raffle-hidden {
    display: none !important;
}

.ascii-raffle-modal {
    position: fixed;
    inset: 0;
    z-index: 100005;
    background: rgba(2, 4, 9, 0.86);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    overflow-y: auto;
    touch-action: pan-y;
    user-select: text;
    -webkit-user-select: text;
}

.ascii-raffle-window {
    width: 100%;
    max-width: 1080px;
    max-height: 92dvh;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    background: #050811;
    border: 2px dashed #eab308;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.95), 0 0 14px rgba(234, 179, 8, 0.22);
    padding: 16px 18px;
    color: #f8fafc;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
}

.ascii-raffle-titlebar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 12px;
    border-bottom: 1px dashed #475569;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.ascii-raffle-title {
    color: #fde047;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.ascii-titlebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ascii-admin-gate-box {
    max-width: 480px;
    margin: 24px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ascii-raffle-close {
    background: transparent;
    border: 1px dashed #f87171;
    color: #fca5a5;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
}

.ascii-raffle-close:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ffffff;
}

.ascii-raffle-status-box {
    border: 1px dashed #334155;
    background: #070c18;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ascii-raffle-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.ascii-label {
    color: #94a3b8;
    font-weight: 600;
}

.ascii-val {
    color: #fde047;
    font-weight: 700;
}

.ascii-sep {
    color: #475569;
}

.ascii-countdown-inline {
    color: #38bdf8;
    font-weight: 700;
}

.ascii-status-open {
    color: #4ade80;
}

.ascii-status-sealed {
    color: #fb7185;
}

.ascii-raffle-admin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.ascii-mini-btn {
    background: #0b1324;
    border: 1px dashed #64748b;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
}

.ascii-mini-btn:hover {
    border-color: #fde047;
    color: #fde047;
}

.ascii-mini-gold {
    border-color: #eab308;
    color: #fef08a;
}

.ascii-mini-green {
    border-color: #22c55e;
    color: #86efac;
}

.ascii-mini-red {
    border-color: #ef4444;
    color: #fca5a5;
}

.ascii-admin-panel {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed #334155;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ascii-admin-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ascii-raffle-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 16px;
    align-items: start;
    width: 100%;
}

.ascii-tree-roster-box,
.ascii-form-box {
    border: 1px dashed #475569;
    background: #070b15;
    padding: 12px 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ascii-action-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.ascii-box-header {
    color: #fde047;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px dashed #334155;
    line-height: 1.35;
}

.ascii-tree-roster-scroll {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    padding: 2px 4px 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.ascii-roster-tree-pre {
    margin: 0 auto;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 10.5px;
    line-height: 1.25;
    color: #4ade80;
    white-space: pre;
    text-align: left;
}

.ascii-participant-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ascii-participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0b1322;
    border: 1px dashed #334155;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    color: #f8fafc;
    cursor: pointer;
    text-align: left;
}

.ascii-participant-item:hover {
    border-color: #fde047;
    background: #111c32;
}

.ascii-participant-name {
    font-weight: 700;
    color: #fef08a;
}

.ascii-participant-tag {
    font-size: 11.5px;
    color: #38bdf8;
    font-weight: 600;
}

.ascii-participant-tag.tag-sealed {
    color: #4ade80;
}

.ascii-roster-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

.ascii-help-text {
    margin: 0 0 10px 0;
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
}

.ascii-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.ascii-field label {
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
}

.ascii-input {
    width: 100%;
    box-sizing: border-box;
    background: #03060c;
    border: 1px dashed #64748b;
    color: #ffffff;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 10px;
    outline: none;
}

.ascii-input:focus {
    border-color: #fde047;
    box-shadow: 0 0 8px rgba(253, 224, 71, 0.25);
}

.ascii-input-sm {
    width: auto;
    font-size: 12px;
    padding: 5px 8px;
}

.ascii-pass-wrap {
    display: flex;
    gap: 6px;
}

.ascii-pass-toggle {
    background: #0e172a;
    border: 1px dashed #64748b;
    color: #fde047;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 10px;
    cursor: pointer;
    white-space: nowrap;
}

.ascii-submit-btn {
    width: 100%;
    background: #0b1528;
    border: 2px dashed #4ade80;
    color: #4ade80;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 10px;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.02em;
}

.ascii-submit-btn.ascii-btn-green:hover {
    background: rgba(34, 197, 94, 0.16);
    color: #ffffff;
}

.ascii-submit-btn.ascii-btn-gold {
    border-color: #facc15;
    color: #fde047;
}

.ascii-submit-btn.ascii-btn-gold:hover {
    background: rgba(250, 204, 21, 0.16);
    color: #ffffff;
}

.ascii-submit-btn.ascii-btn-cyan {
    border-color: #38bdf8;
    color: #7dd3fc;
}

.ascii-submit-btn.ascii-btn-cyan:hover {
    background: rgba(56, 189, 248, 0.18);
    color: #ffffff;
}

.ascii-submit-btn.ascii-btn-red {
    border-color: #f87171;
    color: #fca5a5;
    margin-top: 8px;
}

.ascii-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ascii-feedback-msg {
    border: 1px dashed #fde047;
    background: #0d1629;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #fef08a;
}

.ascii-feedback-msg.msg-error {
    border-color: #ef4444;
    color: #fca5a5;
}

.ascii-feedback-msg.msg-success {
    border-color: #22c55e;
    color: #86efac;
}

/* Elder-Friendly High-Visibility Sealed Envelope Reveal Card */
.ascii-reveal-card {
    border: 2px dashed #fde047;
    background: #091326;
    padding: 16px 14px;
    text-align: center;
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.25);
}

.ascii-reveal-header {
    color: #fde047;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.ascii-reveal-owner {
    font-size: 16px;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.ascii-reveal-owner strong {
    color: #38bdf8;
}

.ascii-reveal-sub {
    font-size: 12.5px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.ascii-reveal-family {
    font-size: 13px;
    color: #93c5fd;
    margin-bottom: 10px;
    font-weight: 600;
}

.ascii-reveal-target-box {
    border: 2px dashed #4ade80;
    background: #040914;
    padding: 18px 12px;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.ascii-reveal-target-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ascii-reveal-target-box strong {
    font-size: 26px;
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
    letter-spacing: 0.04em;
}

.ascii-reveal-target-fam {
    font-size: 13.5px;
    color: #fde047;
    font-weight: 600;
}

.ascii-reveal-arrow {
    color: #fde047;
    font-size: 18px;
    font-weight: 700;
}

.ascii-reveal-warn {
    font-size: 11.5px;
    color: #fda4af;
    margin-top: 8px;
}

.ascii-personal-window {
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ascii-personal-roster-box {
    border: 1px dashed #334155;
    background: #060b16;
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ascii-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
}

.ascii-field {
    min-width: 0;
}

select.ascii-input {
    max-width: 100%;
    text-overflow: ellipsis;
}

.ascii-draw-subactions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.ascii-draw-subactions .ascii-mini-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 7px 8px;
}

/* Family Group Cards & Member One-Click Link Rows */
.ascii-family-card {
    border: 1px dashed #3b82f6;
    background: #08101f;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.ascii-family-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    border-bottom: 1px dashed #1e293b;
    padding-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
}

.ascii-member-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: #0c1629;
    border: 1px dashed #334155;
    padding: 8px 10px;
    font-size: 12.5px;
    box-sizing: border-box;
}

.ascii-member-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.ascii-role-badge {
    font-size: 10.5px;
    padding: 2px 6px;
    border: 1px dashed #475569;
    color: #cbd5e1;
    font-weight: 700;
    flex-shrink: 0;
}

.ascii-role-badge.role-anne {
    border-color: #f472b6;
    color: #fbcfe8;
}

.ascii-role-badge.role-baba {
    border-color: #38bdf8;
    color: #bae6fd;
}

.ascii-role-badge.role-cocuk {
    border-color: #4ade80;
    color: #bbf7d0;
}

.ascii-member-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    width: 100%;
}

.ascii-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #091324;
    border: 1px dashed #22c55e;
    color: #86efac;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.ascii-link-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #ffffff;
}

.ascii-link-btn.btn-copy {
    border-color: #eab308;
    color: #fef08a;
}

.ascii-link-btn.btn-del {
    border-color: #ef4444;
    color: #fca5a5;
}

/* 6-Point Mathematical Verification Proof Box */
.ascii-verification-box {
    border: 1px dashed #22c55e;
    background: #040d0a;
    padding: 10px;
    overflow-x: auto;
}

.ascii-verification-pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #86efac;
    white-space: pre;
}

/* Ultra-Clean, Mobile-First & Elder-Friendly Personal Envelope Card */
.ascii-personal-clean-card {
    width: min(92vw, 520px);
    box-sizing: border-box;
    background: #060b16;
    border: 2px solid rgba(250, 204, 21, 0.55);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.92), 0 0 28px rgba(250, 204, 21, 0.14);
    padding: clamp(22px, 5vw, 34px) clamp(16px, 5vw, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ascii-personal-clean-label {
    font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    font-weight: 600;
    line-height: 1.45;
    color: #e2e8f0;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.ascii-personal-clean-target {
    width: 100%;
    box-sizing: border-box;
    background: #030712;
    border: 2px dashed #4ade80;
    padding: clamp(18px, 4.5vw, 26px) clamp(12px, 3vw, 20px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ascii-personal-clean-target strong {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.4rem, 6vw, 2.35rem);
    font-weight: 800;
    color: #4ade80;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;
    max-width: 100%;
}

.ascii-personal-close-btn {
    margin-top: 4px;
    width: 100%;
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.55);
    color: #dcfce7;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(0.95rem, 3.8vw, 1.05rem);
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ascii-personal-close-btn:hover,
.ascii-personal-close-btn:active {
    background: rgba(74, 222, 128, 0.24);
    color: #ffffff;
}

/* ==========================================================================
   3. MOBILE & TABLET RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 860px) {
    .ascii-raffle-modal {
        padding: 8px;
        align-items: flex-start;
    }

    .ascii-raffle-window {
        padding: 12px 10px;
        max-height: 96dvh;
    }

    .ascii-raffle-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .ascii-tree-roster-scroll {
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .ascii-hero-header {
        margin-top: calc(env(safe-area-inset-top, 0px) + 4px);
    }

    .ascii-countdown-pre {
        font-size: 6.5px;
        line-height: 1.04;
    }

    .ascii-cmd-btn {
        font-size: 10px;
        padding: 2px 5px;
    }

    .ascii-raffle-title {
        font-size: 11.5px;
    }

    .ascii-raffle-close,
    .ascii-titlebar-actions .ascii-mini-btn {
        padding: 6px 10px;
        font-size: 11.5px;
    }

    .ascii-raffle-status-row {
        font-size: 11.5px;
    }

    .ascii-input {
        font-size: 15px;
        padding: 10px 11px;
    }

    .ascii-submit-btn {
        font-size: 12.5px;
        padding: 12px 10px;
        line-height: 1.35;
    }

    .ascii-reveal-target-box strong {
        font-size: 20px;
    }
}

@media (max-width: 540px) {
    .ascii-field-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .ascii-draw-subactions {
        grid-template-columns: minmax(0, 1fr);
    }

    .ascii-member-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .ascii-link-btn {
        font-size: 11px;
        padding: 8px 6px;
    }
}

@media (max-width: 400px) {
    .ascii-countdown-pre {
        font-size: 6.4px;
    }
}
