/* ============================================================
   RP Plot Board, Ads & Publication Sheet
   ============================================================ */

/* --- Lobby plot controls --- */
.rp-board-panels {
    margin-top: 24px;
}

#plot-prologue-input {
    width: 100%;
    height: 120px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    resize: none;
    margin-bottom: 12px;
    transition: border-color var(--duration);
}

#plot-prologue-input:focus {
    outline: none;
    border-color: var(--c-rp);
}

/* --- Plot prologue banner --- */
.plot-prologue-banner {
    margin: 20px auto 24px;
    width: 92%;
    max-width: 580px;
    padding: 24px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: prologueFadeIn 0.3s var(--ease);
    z-index: 5;
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

@keyframes prologueFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plot-prologue-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-rp);
    margin-bottom: 12px;
}

.plot-prologue-text {
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text);
    font-family: var(--font);
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    padding-left: 12px;
    border-left: 3px solid var(--c-rp);
}

.plot-prologue-subsect {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-2);
}

.plot-prologue-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(124, 58, 237, 0.03);
    pointer-events: none;
}

/* --- Board container and cards --- */
.rp-plot-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rp-plot-board__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.rp-board-refresh-btn {
    display: none !important;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--c-rp);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: var(--fs-lg);
    cursor: pointer;
    transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), filter var(--duration) var(--ease);
}

.rp-board-refresh-btn:hover {
    filter: brightness(1.15);
    background: rgba(124, 58, 237, 0.2);
    transform: rotate(15deg);
}

.rp-plot-board__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rp-plot-board__empty {
    text-align: center;
    padding: 32px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-3);
    font-size: var(--fs-sm);
    line-height: 1.6;
    background: var(--surface-2);
}

.rp-ad-card {
    position: relative;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rp-ad-card:hover {
    border-color: var(--c-rp);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

.rp-ad-card--loading {
    opacity: 0.6;
    pointer-events: none;
}

.rp-ad-card--locked {
    border-color: rgba(251, 146, 60, 0.48);
    background:
        linear-gradient(135deg, rgba(251, 146, 60, 0.12), rgba(124, 58, 237, 0.04)),
        var(--surface-2);
    cursor: not-allowed;
}

.rp-ad-card--locked-by-me {
    border-color: rgba(45, 212, 191, 0.52);
    background:
        linear-gradient(135deg, rgba(45, 212, 191, 0.11), rgba(124, 58, 237, 0.04)),
        var(--surface-2);
}

.rp-ad-card--friend {
    border-color: rgba(34, 197, 94, 0.42);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(124, 58, 237, 0.04)),
        var(--surface-2);
}

.rp-ad-card--locked:hover,
.rp-ad-card--locked-by-me:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.12);
}

body.light .rp-ad-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light .rp-ad-card:hover {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
}

.rp-ad-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.rp-ad-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rp-ad-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
}

.rp-ad-badge--gender {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.rp-ad-badge--seek {
    background: rgba(244, 114, 182, 0.15);
    color: #f472b6;
}

.rp-ad-badge--mode {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
}

.rp-ad-badge--role {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.rp-ad-badge--friend {
    background: rgba(34, 197, 94, 0.16);
    color: #22c55e;
}

body.light .rp-ad-badge--gender {
    color: #2563eb;
}

body.light .rp-ad-badge--seek {
    color: #db2777;
}

body.light .rp-ad-badge--mode {
    color: #0d9488;
}

body.light .rp-ad-badge--role {
    color: #d97706;
}

body.light .rp-ad-badge--friend {
    color: #15803d;
}

.rp-ad-card__time {
    flex: 0 0 auto;
    font-size: var(--fs-xs);
    color: var(--text-3);
    white-space: nowrap;
}

.rp-ad-card__plot {
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text);
    font-family: var(--font);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    word-wrap: break-word;
}

.rp-ad-card__lock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 12px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 146, 60, 0.32);
    background: rgba(251, 146, 60, 0.1);
    color: #fbbf24;
    font-size: var(--fs-xs);
    font-weight: 800;
    line-height: 1.35;
}

.rp-ad-card__lock-status[hidden] {
    display: none;
}

.rp-ad-card__lock-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.rp-ad-card--locked-by-me .rp-ad-card__lock-status {
    border-color: rgba(45, 212, 191, 0.32);
    background: rgba(45, 212, 191, 0.1);
    color: #5eead4;
}

.rp-ad-card--locked-by-me .rp-ad-card__lock-dot {
    background: #2dd4bf;
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}

.rp-ad-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
    min-height: 0;
}

.rp-ad-tag {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    background: rgba(124, 58, 237, 0.1);
    color: var(--c-rp);
}

.rp-ad-card__join-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--c-rp);
    color: #ffffff;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter var(--duration) var(--ease), opacity var(--duration) var(--ease), background var(--duration) var(--ease);
}

.rp-ad-card__join-btn:hover {
    filter: brightness(1.1);
}

.rp-ad-card__join-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    filter: none;
}

.rp-ad-card--locked .rp-ad-card__join-btn:disabled {
    border: 1px solid rgba(251, 146, 60, 0.3);
    background: rgba(251, 146, 60, 0.14);
    color: #fbbf24;
}

.rp-ad-card--locked-by-me .rp-ad-card__join-btn {
    background: rgba(45, 212, 191, 0.18);
    color: #5eead4;
}

.rp-board-error {
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.13);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
    animation: msgSlideIn 0.2s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rp-board-filter-count {
    font-size: 12px;
    opacity: 0.55;
    padding: 2px 4px 8px;
    text-align: right;
}
.rp-plot-board__header .rp-board-filter-count {
    padding: 0;
    margin: 0 0 0 auto;
    align-self: center;
    font-weight: 500;
}

/* --- Offer panel --- */
.rp-plot-offer-area {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.rp-my-ad-status {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
    font-size: var(--fs-sm);
    font-weight: 700;
    margin-bottom: 12px;
    animation: adStatusAppear 0.3s cubic-bezier(0.25, 1, 0.35, 1) both;
}

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

body.light .rp-my-ad-status {
    color: #16a34a;
}

.rp-offer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rp-publish-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--c-rp);
    color: #ffffff;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease), background var(--duration) var(--ease);
}

.rp-publish-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.rp-retract-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease), background var(--duration) var(--ease);
}

.rp-retract-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.2);
}

.rp-plot-offer-hint {
    margin-top: 10px;
    font-size: var(--fs-xs);
    color: var(--text-3);
    line-height: 1.5;
}

/* --- Publish bottom sheet --- */
.plot-publish-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 10020;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.35, 1), visibility 0s linear 0.35s;
}

.plot-publish-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.35, 1), visibility 0s linear 0s;
}

.plot-publish-sheet {
    position: fixed;
    bottom: 16px;
    left: 50%;
    right: auto;
    width: min(calc(100vw - 32px), var(--max-w));
    max-height: min(86dvh, 760px);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    z-index: 10021;
    transform: translate(-50%, calc(100% + 32px));
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.35, 1), visibility 0s linear 0.35s;
    border: 1px solid var(--border);
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.plot-publish-sheet.open {
    transform: translate(-50%, 0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.35, 1), visibility 0s linear 0s;
}

.plot-publish-sheet__handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-2);
    margin: 10px auto 0;
    flex-shrink: 0;
}

.plot-publish-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.plot-publish-sheet__title {
    font-size: var(--fs-base);
    font-weight: 800;
    color: var(--text);
}

.plot-publish-sheet__close {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration), color var(--duration);
}

.plot-publish-sheet__close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.plot-publish-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 14px 18px;
    display: flex;
    flex-direction: column;
}

.pad-section {
    margin-bottom: 10px;
}

.pad-section-large {
    margin-bottom: 12px;
}

.pad-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-2);
    font-size: var(--fs-sm);
    cursor: pointer;
    user-select: none;
}

.pad-checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--c-rp);
}

.pad-filter-title {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label-hint {
    opacity: 0.5;
    font-size: var(--fs-xs);
    font-weight: 400;
}

.pad-error-msg {
    display: none;
    color: #ef4444;
    font-size: var(--fs-sm);
    margin-bottom: 12px;
    text-align: center;
}

.pad-plot-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 72px;
    max-height: 400px;
    padding: 8px 12px 14px;
    background: rgba(167, 139, 250, 0.04);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 8px;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    outline: none;
    line-height: 1.45;
}

.pad-plot-textarea:focus {
    border-color: rgba(196, 181, 253, 0.72);
    box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.12);
}

body.light .pad-plot-textarea {
    background: rgba(167, 139, 250, 0.04);
    border-color: rgba(122, 90, 248, 0.25);
    color: #111827;
}

.pad-fetish-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pad-fetish-input {
    flex: 1;
    min-width: 70px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.2);
    background: rgba(167, 139, 250, 0.04);
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    flex-grow: 1;
}

.pad-fetish-input:focus {
    border-color: rgba(196, 181, 253, 0.7);
    box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.1);
}

body.light .pad-fetish-input {
    background: rgba(167, 139, 250, 0.04);
    border-color: rgba(122, 90, 248, 0.22);
    color: #111827;
}

.pad-private-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
}

body.light .pad-private-divider {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.14);
}

.pad-clear-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    color: rgba(167, 139, 250, 0.7);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.pad-clear-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

body.light .pad-clear-btn {
    color: rgba(109, 40, 217, 0.6);
}

body.light .pad-clear-btn:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.07);
}

/* --- Plot intro cards rendered in chat --- */
.intro-msg-card {
    margin: 8px auto 16px;
    width: 92%;
    max-width: 580px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(30, 27, 46, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(167, 139, 250, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: prologueFadeIn 0.5s cubic-bezier(0.25, 1, 0.35, 1) forwards;
    box-sizing: border-box;
}

body.light .intro-msg-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 8px 24px rgba(122, 90, 248, 0.1);
}

.intro-msg-card__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.intro-msg-card__label::before {
    content: none;
    font-size: 15px;
}

body.light .intro-msg-card__label {
    color: #8b5cf6;
}

.intro-msg-card__text {
    font-size: 14.5px;
    line-height: 1.6;
    color: #f3f4f6;
    font-family: var(--font);
    white-space: pre-wrap;
    word-break: break-word;
    border-left: 2px solid rgba(167, 139, 250, 0.4);
    padding-left: 14px;
}

body.light .intro-msg-card__text {
    color: #1f2937;
}

/* --- Ad preview modal --- */
.ad-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.26s ease, opacity 0.26s ease;
}

.ad-preview-overlay--open {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.ad-preview-modal {
    position: fixed;
    bottom: 16px;
    left: 50%;
    right: auto;
    width: min(calc(100vw - 32px), var(--max-w));
    max-height: min(82dvh, 720px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1201;
    transform: translate(-50%, calc(100% + 32px));
    transition: transform 0.35s var(--ease);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
}

.ad-preview-modal--open {
    transform: translate(-50%, 0);
}

.ad-preview-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-2);
    margin: -8px auto 8px;
    flex-shrink: 0;
}

.ad-preview-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration), color var(--duration);
}

.ad-preview-modal__close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.ad-preview-modal__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-right: 40px;
}

.ad-preview-modal__time {
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-top: -8px;
}

.ad-preview-modal__lock-timer {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px dashed var(--c-rp);
    border-radius: var(--radius-sm);
    color: var(--c-rp);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-preview-modal__section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-preview-modal__section-title {
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
}

.ad-preview-modal__section-body {
    font-size: var(--fs-base);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.ad-preview-modal__section+.ad-preview-modal__section {
    padding-top: 16px;
    border-top: 1px dashed var(--border-2);
}

.ad-preview-modal__join-btn {
    margin-top: 12px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--c-rp);
    color: white;
    font-size: var(--fs-lg);
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--duration);
}

.ad-preview-modal__join-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .rp-mode-tabs {
        grid-template-columns: 1fr;
    }

    .rp-mode-tab {
        min-height: 44px;
        padding: 9px 10px;
    }

    #plot-prologue-input {
        min-height: 120px;
    }

    .rp-board-panels {
        margin-top: 32px;
    }

    .plot-publish-sheet {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 92dvh;
        border-right: none;
        border-bottom: none;
        border-left: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }

    .plot-publish-sheet.open {
        transform: translateY(0);
    }

    .ad-preview-modal {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 85dvh;
        border-right: none;
        border-bottom: none;
        border-left: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }

    .ad-preview-modal--open {
        transform: translateY(0);
    }
}

/* Guest Locking & Blurred Overlay */
.rp-plot-board.is-guest-locked {
    position: relative;
    overflow: hidden;
    min-height: 350px;
}

/* Blur active cards beneath */
.rp-plot-board.is-guest-locked .rp-plot-board__list .rp-ad-card {
    filter: blur(2px) grayscale(8%);
    opacity: 0.65;
    pointer-events: none;
    user-select: none;
}

/* Hide empty states for guests to keep active movement view clean */
.rp-plot-board.is-guest-locked .rp-plot-board__empty {
    display: none !important;
}

/* Guest Lock Glass Overlay Container */
.rp-plot-board__guest-overlay {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    background: rgba(17, 20, 24, 0.25);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    animation: fadeIn var(--duration) var(--ease) forwards;
}

body.light .rp-plot-board__guest-overlay {
    background: rgba(243, 244, 246, 0.25);
}

/* Guest Lock Premium Card */
.rp-plot-board__guest-card {
    max-width: 380px;
    width: 100%;
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: rgba(19, 21, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    text-align: center;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

body.light .rp-plot-board__guest-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.rp-plot-board__guest-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(124, 90, 248, 0.1);
    border: 1px solid rgba(124, 90, 248, 0.2);
    margin-bottom: 16px;
    transition: transform var(--duration) var(--ease);
}

.rp-plot-board__guest-card:hover .rp-plot-board__guest-icon {
    transform: scale(1.08) rotate(5deg);
}

.rp-plot-board__guest-title {
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.2px;
}

.rp-plot-board__guest-text {
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--text-2);
    margin: 0 0 20px;
}

.rp-plot-board__guest-btn {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--c-rp) 0%, #6366f1 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 90, 248, 0.3);
    transition: filter var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.rp-plot-board__guest-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(124, 90, 248, 0.45);
    transform: translateY(-1px);
}

.rp-plot-board__guest-btn:active {
    transform: translateY(0);
}

/* Visual lock for Offer form and Start roleplay match button */
.rp-plot-offer-area.is-guest-locked {
    position: relative !important;
    overflow: hidden !important;
}
.rp-plot-offer-area.is-guest-locked > *:not(.rp-plot-submit__guest-overlay) {
    filter: blur(1.5px) !important;
    opacity: 0.45 !important;
    pointer-events: none !important;
}
.start-chat-btn.rp-btn.is-guest-locked {
    position: relative;
    opacity: 0.5;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Minimalist Guest submit lock overlay styles */
.rp-plot-submit__guest-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    z-index: 10;
    background: rgba(17, 20, 24, 0.15);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    pointer-events: auto !important;
    animation: fadeIn var(--duration) var(--ease) forwards;
}

.rp-plot-submit__guest-card {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: scaleIn var(--duration) var(--ease) forwards;
}

.rp-plot-submit__guest-text {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-2);
    margin-right: 12px;
    white-space: nowrap;
}

.rp-plot-submit__guest-btn {
    background: var(--c-rp);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    transition: filter var(--duration) var(--ease), transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.rp-plot-submit__guest-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Animations */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
