/* =====================
   BOARD SCREEN
   ===================== */
#screen-board {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    transition: background-color 0.4s ease;
}

/* Spotlight Vignette Overlay */
#screen-board::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

/* Edit Mode Desk Shift */
#screen-board.edit-active {
    background-color: #D3D3D3; /* Light grey workspace desk */
}

#screen-board.edit-active::before {
    opacity: 1;
}

/* Make headers legible */
.board-username, .board-followers, #btn-settings {
    transition: color 0.4s ease;
}

#screen-board.edit-active .board-followers {
    color: #4b5563; /* Slightly darker for contrast on grey */
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 2px;
    width: var(--wall-frame-width);
    max-width: calc(100% - 32px);
    margin: 0 auto;
    flex-shrink: 0;
}

.board-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.board-username {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.board-followers {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
}

.board-visitor-frame {
    display: contents;
}

.board-canvas-wrap {
    aspect-ratio: 408 / 666;
    flex: 0 0 auto;
    max-width: calc(100% - 32px);
    width: min(var(--wall-frame-width), calc((100dvh - 110px) * 408 / 666));
    height: auto;
    align-self: center;
    margin: 0 auto 16px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    /* Elevation shadow — stronger on sides and bottom */
    box-shadow:
        -6px 0 16px rgba(0, 0, 0, 0.10),
        6px 0 16px rgba(0, 0, 0, 0.10),
        0 12px 24px rgba(0, 0, 0, 0.16),
        0 20px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.board-canvas-wrap.has-active-layer {
    transform: none;
}

@media (pointer: coarse) {
    .board-canvas-wrap {
        aspect-ratio: 408 / 666;
        flex: 0 0 auto;
        width: min(calc(100% - 32px), calc((100dvh - 88px) * 408 / 666), 430px);
        height: auto;
    }

    body.board-editing-mode .board-canvas-wrap {
        width: min(calc(100% - 32px), calc((100dvh - 88px) * 408 / 666), 430px);
    }
}

.board-canvas {
    width: 100%;
    height: 100%;
    /* White pegboard with custom background image */
    background-image: url('../Component/board.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.board-profile-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 8px solid #e2bbf0;
    background: white;
    z-index: 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.board-profile-circle:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.board-profile-circle:active {
    transform: translate(-50%, -50%) scale(0.98);
}

.board-profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fab-edit {
    height: 32px;
    border-radius: 50px;
    background: #F7EEFF;
    border: 1px solid #D9B8FF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: #1f1f1f;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform var(--t);
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.fab-edit svg {
    width: 20px !important;
    height: 20px !important;
}

.fab-share {
    background: #1f182b;
    border-color: #36294a;
}

#btn-share-wall,
#btn-edit-board {
    width: 124px;
    height: 44px;
    border-radius: 22px;
    background: #1f182b;
    border: 1px solid #36294a;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(31, 24, 43, 0.22);
}

#btn-share-wall:hover,
#btn-edit-board:hover {
    transform: translateY(-2px);
    background: #312645;
    border-color: #483866;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(31, 24, 43, 0.3);
}

.fab-edit.active-fab {
    background: #3a1d6e;
    border-color: #6d28d9;
    color: #ffffff;
}

.fab-edit.active-fab .icon-pencil {
    display: none !important;
}

.fab-edit.active-fab .icon-check {
    display: block !important;
}

@keyframes editBoardAttention {
    0%, 100% {
        transform: scale(1);
        border-color: #d1d5db;
        box-shadow: var(--shadow-sm);
    }
    35% {
        transform: scale(1.08);
        border-color: #a855f7;
        box-shadow: 0 0 0 5px rgba(168, 85, 247, 0.18);
    }
    70% {
        transform: scale(1.02);
        border-color: #c084fc;
        box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.14);
    }
}

.fab-edit.edit-board-attention {
    animation: editBoardAttention 0.85s ease;
}

.board-edit-undo {
    border-color: #d1d5db;
    background: #ffffff;
    color: #4b5563;
    box-shadow: none;
}

.board-edit-undo:hover:not(:disabled) {
    border-color: #9ca3af;
    background: #f9fafb;
    color: #111111;
}

.board-edit-undo:disabled {
    opacity: 0.38;
    cursor: default;
}

.board-dock {
    position: absolute;
    top: 66px;
    right: max(18px, calc((100% - var(--wall-frame-width)) / 2 + 10px));
    margin: 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 25;
    pointer-events: none;
    transition: opacity var(--t), transform var(--t);
}

#screen-board.edit-active .board-dock {
    display: flex;
}

.board-cta-label {
    display: none;
}

#screen-board.edit-active .board-cta-label {
    color: rgba(255, 255, 255, 0.95);
}

.action-row {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 0;
    width: auto;
    pointer-events: auto;
}

.action-pill-btn {
    flex: 0 0 auto;
    width: 48px;
    max-width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6D6A6A;
    border: 2px solid #464444;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #FFFFFF;
    transition: transform var(--t), box-shadow var(--t);
    padding: 0;
}

.action-btn-label {
    display: none;
}

.action-text-icon {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1;
}

.action-pill-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.action-pill-btn:active {
    transform: scale(0.96);
}

/* ==========================================================
   STORY CAPTURE ARTIFACT SUPPRESSION
   Prevents iOS WebKit SVG compositing engine from rendering
   CSS box-shadow and drop-shadow as muddy grey vertical smudges.
   ========================================================== */
.capturing-story,
.capturing-story * {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.capturing-story .btn-item-delete,
.capturing-story .btn-item-rotate,
.capturing-story .btn-item-manage,
.capturing-story .premium-board-item-badge,
.capturing-story .premium-board-preview-badge {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.capturing-story .board-item {
    outline: none !important;
}
