/* ─────────────────────────────────────────────────────────
   turtleChat — style.css
───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Saira+Stencil+One&family=Sofia&display=swap');

:root {
    --bg:            #f0f2f5;
    --app-bg:        #ffffff;
    --me-bubble:     #007aff;
    --me-text:       #ffffff;
    --them-bubble:   #e9ecef;
    --them-text:     #000000;
    --border:        #d1d5db;
    --system-text:   #8e8e93;
    --safe-top:      env(safe-area-inset-top,    20px);
    --safe-bottom:   env(safe-area-inset-bottom, 20px);

    /* status dot */
    --dot-on:        #34c759;
    --dot-wait:      #ff9f0a;
    --dot-off:       #ff3b30;

    /* modal */
    --modal-bg:      #ffffff;
    --input-bg:      #f2f2f7;
    --label-color:   #3c3c43;

    --msg-font:      'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Themes ─────────────────────────────────────────── */

.theme-turtle {
    --me-bubble:     #34c759;
}

.theme-night-amber, .theme-night-green, .theme-night-blue, .theme-night-retro {
    --bg:            #000000;
    --app-bg:        #0d0d0d;
    --them-bubble:   #1a1a1a;
    --them-text:     #cccccc;
    --border:        #333333;
    --modal-bg:      #1a1a1a;
    --input-bg:      #262626;
    --label-color:   #aaaaaa;
}

.theme-night-amber {
    --me-bubble:     #ffbf00;
    --me-text:       #000000;
    --system-text:   #cc9900;
}

.theme-night-green {
    --me-bubble:     #00ff41;
    --me-text:       #000000;
    --system-text:   #008f11;
}

.theme-night-blue {
    --me-bubble:     #add8e6;
    --me-text:       #000000;
    --system-text:   #4682b4;
}

.theme-night-retro {
    --me-bubble:     #ff0000;
    --me-text:       #000000;
    --system-text:   #8b0000;
    --msg-font:      'Courier New', Courier, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: var(--bg);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ── App shell ─────────────────────────────────────────── */
#app-container {
    width: 100%;
    max-width: 600px;
    height: 100dvh;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

@media (min-width: 601px) {
    body { padding: 20px; }
    #app-container {
        height: 90vh;
        border-radius: 24px;
        overflow: hidden;
        border: 8px solid #2a2a2a;
    }
}

/* ── Header ────────────────────────────────────────────── */
header {
    background: var(--app-bg);
    opacity: 0.95;
    backdrop-filter: blur(10px);
    padding: calc(var(--safe-top) + 12px) 16px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.header-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    display: flex;
    align-items: center; /* Forces the image and text to align vertically centered */
    font-size: 1.15rem;
    font-weight: 700;
}

.header-icon {
    /* Sizing based on the line-height (1em) of the text so it scales. */
    height: 1.25em; /* This height matches the visual presence of the old emoji. */
    width: auto; /* Maintains the square aspect ratio. */
    margin-right: 8px; /* Adds spacing before the word "turtleChat" */
    
    /* Good practice for small UI images: */
    flex-shrink: 0; /* Prevents it from getting squished. */
    object-fit: contain; /* Prevents distortion if the user swaps to a non-square image later. */
}


#status-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--them-bubble);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--system-text);
    max-width: 130px;
    overflow: hidden;
}

#status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--dot-off);
    flex-shrink: 0;
    transition: background .3s;
}
#status-dot.on   { background: var(--dot-on); }
#status-dot.wait { background: var(--dot-wait); }

#status-nick {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#setup-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    opacity: .7;
    transition: opacity .15s;
}
#setup-btn:active { opacity: 1; }

#setup-btn {
    background: transparent;
    border: none;
    color: var(--system-text); /* Matches the gray/neutral header elements */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-left: 8px;
    transition: color 0.2s, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

#setup-btn:hover {
    color: var(--me-bubble); /* Shifts to your primary blue on hover */
}

#setup-btn:active {
    transform: scale(0.9) rotate(15deg); /* Tiny mechanical rotation effect when clicked! */
}

/* ── Chat area ─────────────────────────────────────────── */
#chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* ── Message rows ──────────────────────────────────────── */
.message-row {
    display: flex;
    width: 100%;
}
.message-row.me     { justify-content: flex-end; }
.message-row.them   { justify-content: flex-start; }
.message-row.system { justify-content: center; }

/* ── Sender label ──────────────────────────────────────── */
.message-col { display: flex; flex-direction: column; max-width: 78%; }
.message-row.me .message-col { align-items: flex-end; }

.sender-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--system-text);
    margin-bottom: 3px;
    padding: 0 4px;
}

/* ── Text bubbles ──────────────────────────────────────── */
.bubble {
    padding: 10px 14px;
    border-radius: 20px;
    font-size: .975rem;
    font-family: var(--msg-font);
    line-height: 1.45;
    word-wrap: break-word;
    animation: popIn .22s cubic-bezier(.175,.885,.32,1.275) forwards;
    transform-origin: bottom center;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(.82); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Reference images (bot <img> tags) ──────────────────── */
/* Same 280px cap as the logo/SVG bubbles, click to expand. Tall,
   square and landscape all letterbox inside the box: max-width and
   max-height cap it, object-fit keeps the aspect ratio, nothing
   overflows the bubble. */
.bubble img.ref-img {
    display: block;
    max-width: 280px;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer;
    margin: 4px 0;
}
.bubble img.ref-img:active { transform: scale(0.97); }

.message-row.me   .bubble { background: var(--me-bubble); color: var(--me-text); border-bottom-right-radius: 4px; }
.message-row.them .bubble { background: var(--them-bubble); color: var(--them-text); border-bottom-left-radius: 4px; }

/* ── System messages ───────────────────────────────────── */
.system-msg {
    font-size: .72rem;
    color: var(--system-text);
    text-align: center;
    padding: 2px 0;
}

/* ── History divider ───────────────────────────────────── */
.history-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--system-text);
    font-size: .7rem;
    font-weight: 600;
}
.history-divider::before,
.history-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Logo / canvas bubbles ─────────────────────────────── */
.bubble.logo-bubble {
    padding: 8px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 18px;
    max-width: 100%;
}
.message-row.me .bubble.logo-bubble { border-color: var(--me-bubble); }

.canvas-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,.07);
    display: flex;
    justify-content: center;
    align-items: center;
}
/* ── Restored Canvas Interactivity ─────────────────────── */
.canvas-wrapper {
    cursor: pointer;
    transition: transform 0.1s;
}
.canvas-wrapper:active {
    transform: scale(0.97);
}

canvas {
    display: block;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    background:
        linear-gradient(rgba(0,0,0,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px),
        #fff;
    background-size: 20px 20px;
}

.logo-indicator {
    font-size: .7rem;
    color: var(--system-text);
    margin-top: 4px;
    padding: 0 4px;
    font-weight: 600;
}

/* ── Footer ────────────────────────────────────────────── */
footer {
    background: var(--app-bg);
    padding: 10px 16px calc(var(--safe-bottom) + 10px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

#msg-input {
    flex: 1;
    background: var(--them-bubble);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: .975rem;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
    line-height: 1.4;
}
#msg-input:disabled { opacity: .5; }

#send-btn {
    background: var(--me-bubble);
    color: #fff;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .1s, background .15s;
}
#send-btn:active   { transform: scale(.88); }
#send-btn:disabled { background: #a0cbfc; cursor: not-allowed; }


/* ════════════════════════════════════════════════════════
   SETUP MODAL
════════════════════════════════════════════════════════ */

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: flex-end;   /* sheet from bottom on mobile */
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

@media (min-width: 500px) {
    #modal-overlay { align-items: center; }
}

#modal-overlay.hidden { display: none; }

#setup-modal {
    background: var(--modal-bg);
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 0 0 calc(var(--safe-bottom) + 8px);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 500px) {
    #setup-modal {
        border-radius: 20px;
        max-height: 80vh;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--modal-bg);
    z-index: 1;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds perfect spacing between the wrench and the word "Setup" */
    margin: 0;
    color: var(--label-color);
}

.modal-header h2 svg {
    flex-shrink: 0; /* Prevents the icon from getting squished */
}

#modal-close-btn {
    background: transparent;
    border: none;
    color: maroon; /* Forces the SVG to be maroon */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s;
}

#modal-close-btn:hover {
    color: #5a0000; /* Darkens the maroon slightly when hovered */
    transform: scale(1.1); /* Slight pop */
}

#modal-close-btn:active {
    transform: scale(0.9); /* Squeezes down when clicked */
}

/* ── Tabs ─────────────────────────────────────────────── */
.modal-tabs {
    display: flex;
    padding: 10px 20px 0;
    gap: 6px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 10px;
    background: var(--them-bubble);
    color: var(--system-text);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.tab-btn.active {
    background: var(--me-bubble);
    color: #fff;
}

/* ── Modal Tabs ─────────────────────────────────────────────────── */
.modal-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--system-text); /* Sets the inactive gray state for text AND svg */
    padding: 10px 0;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    flex-direction: column; /* Stacks the icon above the text */
    align-items: center;
    gap: 6px; /* Space between icon and text */
    transition: all 0.2s ease;
}

.tab-btn svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Active Tab State ONLY ── */
.tab-btn.active {
    background: var(--me-bubble); /* Makes the active tab a blue box */
    color: #ffffff;               /* Forces the text to be white */
    border-bottom: 2px solid var(--me-bubble);
    border-radius: 8px;           /* Rounds the box slightly so it looks like a clean tab */
}

.tab-btn.active svg {
    color: #ffffff;               /* Forces the SVG icon to be white */
    transform: scale(1.1);
}


.tab-btn:hover:not(.active) {
    color: #555; /* Slight hover state for inactive tabs */
}

/* ── Tab panels ───────────────────────────────────────── */
.tab-panel { display: none; padding: 16px 20px; flex-direction: column; gap: 14px; }
.tab-panel.active { display: flex; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--label-color);
    -webkit-user-select: none;
    user-select: none;
}

label input[type="text"],
label input[type="url"],
label input[type="password"] {
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: .95rem;
    outline: none;
    transition: border-color .15s;
    -webkit-user-select: text;
    user-select: text;
}

label input:focus { border-color: var(--me-bubble); }

label small {
    font-size: .72rem;
    font-weight: 400;
    color: var(--system-text);
}

.input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.input-row input { flex: 1; }

.eye-btn {
    background: var(--input-bg);
    border: none;
    border-radius: 8px;
    width: 38px; height: 38px;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
}
.checkbox-label input { width: auto; }

.subtle-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: var(--system-text);
    text-underline-offset: 2px;
}
.subtle-link:visited { color: inherit; }
/* ── Modal footer ─────────────────────────────────────── */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 6px;
    border-top: 1px solid var(--border);
    gap: 10px;
    flex-shrink: 0;
}

.primary-btn {
    background: var(--me-bubble);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 14px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
.primary-btn:active { opacity: .8; }

.secondary-btn {
    background: var(--them-bubble);
    color: var(--label-color);
    border: none;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background .15s;
}
.secondary-btn:active { background: #d0d4d8; }

.danger-btn {
    background: none;
    color: #ff3b30;
    border: none;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
    white-space: nowrap;
}

#register-result {
    font-size: .8rem;
    min-height: 1.2em;
    font-weight: 600;
}
#register-result.ok  { color: #34c759; }
#register-result.err { color: #ff3b30; }

.hidden {
    display: none !important;
}

/* ── SVG bubbles ───────────────────────────────────────── */
.bubble.svg-bubble {
    padding: 8px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 18px;
    max-width: 100%;
}
.message-row.me .bubble.svg-bubble { border-color: var(--me-bubble); }

.svg-wrapper {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    max-width: 280px;
}
.svg-wrapper:active { transform: scale(0.97); }
.svg-wrapper svg { max-width: 280px; max-height: 280px; display: block; }

/* ── Clipboard button ──────────────────────────────────── */
.copy-code-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    padding: 0 2px;
    opacity: .5;
    transition: opacity .15s;
    vertical-align: middle;
    line-height: 1;
}
.copy-code-btn:active { opacity: 1; }

/* ── Four11 button ─────────────────────────────────────── */
.four11-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1.5px solid currentColor;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    color: inherit;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.four11-btn:hover { background: rgba(255,255,255,.25); }
.four11-btn:disabled { opacity: .55; cursor: default; }

/* ── PM bubbles ─────────────────────────────────────────── */
.pm-row { justify-content: flex-start; }
.pm-row.mine { justify-content: flex-end; }

.pm-bubble {
    background: linear-gradient(135deg, #0d1b2a, #1b2838);
    border: 1.5px solid #4a9eff;
    border-radius: 16px;
    padding: 10px 14px;
    max-width: 80%;
    animation: popIn .22s cubic-bezier(.175,.885,.32,1.275) forwards;
}

.pm-header {
    font-size: .68rem;
    font-weight: 700;
    color: #4a9eff;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.pm-label { flex: 1; }

.pm-receipt {
    font-size: .85rem;
    flex-shrink: 0;
    transition: opacity .3s;
}

.pm-text {
    font-size: .95rem;
    color: #d0e8ff;
    line-height: 1.45;
    word-wrap: break-word;
}

/* ── IM bubbles ─────────────────────────────────────────── */
.im-row { justify-content: center; }

.im-bubble {
    background: rgba(255, 159, 10, 0.1);
    border: 1px solid rgba(255, 159, 10, 0.3);
    border-radius: 16px;
    padding: 8px 16px;
    max-width: 85%;
    text-align: center;
    transition: opacity 3s ease;
    animation: popIn .22s cubic-bezier(.175,.885,.32,1.275) forwards;
}

.im-bubble.faded { opacity: 0.25; }

.im-nick {
    font-size: .68rem;
    font-weight: 700;
    color: #ff9f0a;
    margin-bottom: 3px;
}

.im-text {
    font-size: .9rem;
    color: #b87000;
    font-style: italic;
    line-height: 1.4;
}

/* ── AI Tab ─────────────────────────────────────────────── */
.ai-hidden { display: none; }

.ai-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-divider {
    text-align: center;
    font-size: .75rem;
    color: var(--system-text);
    padding: 4px 0;
}

#tab-ai select {
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: .95rem;
    outline: none;
    width: 100%;
    -webkit-user-select: text;
    user-select: text;
}
#tab-ai select:focus { border-color: var(--me-bubble); }
#tab-ai select:disabled { opacity: .5; }

#tab-ai textarea {
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: .9rem;
    outline: none;
    width: 100%;
    -webkit-user-select: text;
    user-select: text;
    line-height: 1.4;
}
#tab-ai textarea:focus { border-color: var(--me-bubble); }

img.summoner {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ── PM reply button ─────────────────────────────────────── */
.pm-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4a9eff;
    opacity: 0.5;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity .2s;
}
.pm-reply-btn:hover { opacity: 1; }

/* ── Invite bubbles (extends PM style) ──────────────────── */
.pm-bubble.invite-bubble {
    background: linear-gradient(135deg, #1f1b2e, #2a1b38);
    border: 1.5px solid #a67cff;
    box-shadow: 0 4px 15px rgba(166, 124, 255, 0.15);
}

.invite-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.invite-emoji {
    font-size: 1.1rem;
}

.invite-emoji-right {
    font-size: 1.1rem;
}

.invite-text {
    font-size: .95rem;
    color: #e6ddff;
    line-height: 1.45;
    text-align: center;
    margin-top: 6px;
}

.invite-text strong {
    color: #ffffff;
}

.invite-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 4px;
}

.invite-action-btn {
    background: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px; 
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s;
}

.invite-action-btn:active {
    transform: scale(0.92);
    background: #f0f0f0;
}

/* ── Alias bubbles (extends IM style) ──────────────────── */
.im-bubble.alias-bubble {
    background: rgba(70, 130, 180, 0.12); /* Subtle steelblue tint */
    border-color: rgba(70, 130, 180, 0.5);
    box-shadow: 0 0 10px rgba(70, 130, 180, 0.2);
}

.im-bubble.alias-bubble .im-nick {
    color: steelblue;
}

.im-bubble.alias-bubble .im-text {
    font-style: normal;
}

.alias-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568; 
    font-size: .95rem;
}

.alias-wrapper strong {
    color: steelblue;
    font-weight: 600;
}

#send-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-btn:active:not(:disabled) {
    transform: scale(0.92);
}

#send-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

/* ── Join Request bubbles ──────────────────────────── */
.pm-bubble.join-request-bubble {
    background: linear-gradient(135deg, #1a2a1a, #0a1a0a);
    border: 1.5px solid #34c759;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.15);
}

.pm-bubble.join-request-bubble .pm-header {
    color: #34c759;
}

/* ── Note bubbles (Sticky Notes) ───────────────────────── */

.note-bubble {
    padding: 18px;
    margin: 12px auto;
    box-shadow: 3px 6px 12px rgba(0,0,0,0.18);
    border-radius: 2px;
    min-width: 180px;
    max-width: 85%;
    position: relative;
    transform: rotate(-1.5deg);
    line-height: 1.5;
    word-wrap: break-word;
    animation: popIn .22s cubic-bezier(.175,.885,.32,1.275) forwards;
    cursor: pointer;
}

.note-bubble:nth-child(even) {
    transform: rotate(1.2deg);
}

.note-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-width: 0 16px 16px 0;
    border-style: solid;
    border-color: rgba(0,0,0,0.1) #fff;
    display: block;
    width: 0;
}

.note-self {
    background-color: lemonchiffon;
    color: #8b008b; /* Darker mauve for readability */
    font-family: "Sofia", cursive;
    font-weight: 400;
    font-style: normal;
}

.note-other {
    background-color: skyblue;
    color: steelblue;
}

.note-other .note-content {
    font-family: "Saira Stencil One", sans-serif;
    font-weight: bold;
    font-style: normal;
}

.note-love {
    background-color: #880044; /* Deep, dark pink */
    color: oldlace;
}

.note-love .note-content {
    font-weight: bold;
}

.note-love .note-header .note-time {
    color: #FFB6C1; /* Pale pink */
}

.note-header {
    margin-bottom: 8px;
    line-height: 1.2;
}

.note-time {
    display: block;
    font-family: 'Courier New', Courier, monospace;
    color: darkslategray;
    font-size: 0.85em;
    font-weight: normal;
}

.note-from {
    display: block;
    font-family: var(--msg-font);
    color: black;
    font-size: 0.75em;
    font-weight: normal;
}

.join-text {
    font-size: .95rem;
    color: #d0ffd0;
    line-height: 1.45;
    text-align: center;
    margin-top: 6px;
}


