/* Ramaparticles widget, ramapani.com/page/ramaparticles
   Everything is scoped under .pt-app so it sits cleanly inside the site styles. */

.pt-app {
    --pt-ink: #4b4032;
    --pt-umber: #8b5e3c;
    --pt-umber-deep: #6d4528;
    --pt-paper: #f6f2ea;
    --pt-paper-2: #ece5d8;
    --pt-line: #d9cfbd;
    --pt-glass: rgba(20, 16, 12, 0.55);
    --pt-glass-line: rgba(246, 242, 234, 0.16);
    --pt-icon: #f1e9db;

    container-type: inline-size;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 380px;
    max-height: 82vh;
    margin: 1.5em 0;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    overflow: clip;          /* never scrolls inside, even when something asks it to */
    box-shadow: 0 6px 24px rgba(40, 28, 16, 0.25);
    font-family: Georgia, serif;
    line-height: 1.4;
    color: var(--pt-ink);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pt-app *,
.pt-app *::before,
.pt-app *::after { box-sizing: border-box; }

@media (max-width: 600px) {
    .pt-app { aspect-ratio: 4 / 5; max-height: 78vh; border-radius: 10px; }
}

.pt-app:focus-visible { box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.6), 0 6px 24px rgba(40, 28, 16, 0.25); }

/* Embed and full screen layouts */
.pt-app.pt-embed {
    aspect-ratio: auto;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.pt-app:fullscreen,
.pt-app.pt-fs {
    aspect-ratio: auto;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
.pt-app::backdrop { background: #000; }

.pt-app.pt-fs {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}
html.pt-lock, html.pt-lock body { overflow: hidden !important; }

/* Canvas */
.pt-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: crosshair;
}
.pt-app.pt-idle .pt-canvas { cursor: none; }

/* Control bar */
.pt-bar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--pt-glass);
    border: 1px solid var(--pt-glass-line);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 3;
}
.pt-app.pt-idle .pt-bar,
.pt-app.pt-idle .pt-brand {
    opacity: 0;
    pointer-events: none;
}
.pt-app.pt-idle .pt-bar { transform: translateX(-50%) translateY(8px); }

.pt-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--pt-icon);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.pt-btn svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.pt-btn svg [fill="none"] { fill: none; }
.pt-btn:hover { background: rgba(246, 242, 234, 0.14); }
.pt-btn:focus-visible { outline: 2px solid #e0c08f; outline-offset: 1px; }
.pt-btn[aria-pressed="true"] { background: rgba(224, 192, 143, 0.28); color: #ffe7c2; }
.pt-btn-settings[aria-expanded="true"] { background: rgba(224, 192, 143, 0.28); }

.pt-btn .pt-i-play, .pt-btn .pt-i-unfs { display: none; }
.pt-app.pt-paused .pt-btn .pt-i-play { display: block; }
.pt-app.pt-paused .pt-btn .pt-i-pause { display: none; }
.pt-app:fullscreen .pt-btn .pt-i-fs, .pt-app.pt-fs .pt-btn .pt-i-fs { display: none; }
.pt-app:fullscreen .pt-btn .pt-i-unfs, .pt-app.pt-fs .pt-btn .pt-i-unfs { display: block; }

@container (max-width: 440px) {
    .pt-btn { width: 33px; height: 33px; }
    .pt-btn svg { width: 20px; height: 20px; }
    .pt-bar { gap: 1px; padding: 4px; bottom: 10px; }
}
@container (max-width: 340px) {
    .pt-btn { width: 29px; height: 29px; }
    .pt-btn svg { width: 18px; height: 18px; }
}

.pt-app.pt-inline .pt-canvas { touch-action: pan-y; }
.pt-app.pt-fs .pt-canvas, .pt-app:fullscreen .pt-canvas { touch-action: none; }

/* Centre of gravity marker (shown for touch input) */
.pt-well {
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid rgba(246, 242, 234, 0.55);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
}
.pt-well::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: rgba(246, 242, 234, 0.8);
}
.pt-app.pt-touch .pt-well { opacity: 0.45; }
.pt-app.pt-touch.pt-touching .pt-well { opacity: 0.9; }
.pt-app.pt-repel .pt-well { border-style: dashed; }

/* Big play button */
.pt-bigplay {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 88px;
    height: 88px;
    margin: -44px 0 0 -44px;
    padding: 0;
    display: grid;
    place-items: center;
    background: var(--pt-glass);
    border: 1px solid var(--pt-glass-line);
    border-radius: 50%;
    color: var(--pt-icon);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}
.pt-bigplay svg { width: 40px; height: 40px; fill: currentColor; margin-left: 5px; }
.pt-bigplay:hover { background: rgba(60, 44, 30, 0.7); }
.pt-app.pt-paused .pt-bigplay { opacity: 1; transform: scale(1); pointer-events: auto; }
.pt-app.pt-drawer-open .pt-bigplay { opacity: 0; pointer-events: none; }

/* Hint and brand */
.pt-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: 16px;
    margin: 0;
    padding: 0 16px;
    text-align: center;
    font-size: 15px;
    font-style: italic;
    color: rgba(246, 242, 234, 0.8);
    text-shadow: 0 1px 6px #000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 2;
}
.pt-hint.pt-show { opacity: 1; }

.pt-brand {
    position: absolute;
    left: 14px;
    top: 12px;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: rgba(246, 242, 234, 0.55) !important;
    text-decoration: none !important;
    transition: opacity 0.5s ease, color 0.2s ease;
    z-index: 2;
}
.pt-brand:hover { color: #f6f2ea !important; }
.pt-app:not(.pt-embed):not(.pt-fs):not(:fullscreen) .pt-brand { display: none; }

/* Settings drawer */
.pt-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--pt-paper);
    color: var(--pt-ink);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.38s;
    z-index: 5;
}
.pt-app.pt-drawer-open .pt-drawer {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}
.pt-app.pt-drawer-open .pt-bar { opacity: 0; pointer-events: none; }

@container (max-width: 520px) {
    .pt-drawer { width: 100%; }
}

.pt-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px 20px;
    border-bottom: 1px solid var(--pt-line);
}
.pt-drawer-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: normal;
    color: var(--pt-umber);
}
.pt-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--pt-ink);
    cursor: pointer;
}
.pt-close:hover { background: var(--pt-paper-2); }

.pt-drawer-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.pt-group { padding: 14px 0 6px; border-bottom: 1px solid var(--pt-line); }
.pt-group:last-of-type { border-bottom: 0; }
.pt-group h3 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: normal;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a7a64;
}

.pt-row { margin: 0 0 14px; transition: opacity 0.25s ease; }
.pt-row.pt-disabled { opacity: 0.4; }
.pt-row label,
.pt-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 15px;
    margin: 0 0 4px;
}
.pt-row output {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: var(--pt-umber);
}
.pt-note { margin: 4px 0 0; font-size: 12.5px; color: #7b6d5a; font-style: italic; }

/* Range sliders */
.pt-app input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.pt-app input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--pt-umber) var(--pt-fill, 50%), var(--pt-line) var(--pt-fill, 50%));
}
.pt-app input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--pt-line); }
.pt-app input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--pt-umber); }
.pt-app input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pt-umber);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.pt-app input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pt-umber);
}
.pt-app input[type="range"]:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.5); outline-offset: 2px; border-radius: 4px; }

/* Switches */
.pt-toggle-row { display: flex; align-items: center; justify-content: space-between; }
.pt-toggle-row .pt-label { margin: 0; }
.pt-switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: var(--pt-line);
    cursor: pointer;
    transition: background 0.2s ease;
}
.pt-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}
.pt-switch[aria-checked="true"] { background: var(--pt-umber); }
.pt-switch[aria-checked="true"]::after { transform: translateX(20px); }
.pt-switch:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.6); outline-offset: 2px; }

/* Colour scheme swatches */
.pt-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.pt-swatches button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--pt-ink);
    cursor: pointer;
    text-align: left;
}
.pt-swatches button:hover { border-color: #bba98d; }
.pt-swatches button[aria-checked="true"] { border-color: var(--pt-umber); box-shadow: inset 0 0 0 1px var(--pt-umber); background: #fffaf1; }
.pt-sw {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #000;
}
.pt-sw-colourful { background: radial-gradient(circle at 30% 35%, #ff5d5d 0 3px, transparent 3.5px), radial-gradient(circle at 68% 40%, #5dd0ff 0 3px, transparent 3.5px), radial-gradient(circle at 48% 72%, #ffd34d 0 3px, transparent 3.5px), #000; }
.pt-sw-greyscale { background: radial-gradient(circle at 30% 35%, #fff 0 3px, transparent 3.5px), radial-gradient(circle at 68% 40%, #999 0 3px, transparent 3.5px), radial-gradient(circle at 48% 72%, #555 0 3px, transparent 3.5px), #000; }
.pt-sw-bubbles { background: radial-gradient(circle at 34% 40%, #000 0 3px, #5ff 3.5px 4.5px, transparent 5px), radial-gradient(circle at 66% 62%, #000 0 3px, #fff 3.5px 4.5px, transparent 5px), #000; }
.pt-sw-nored { background: radial-gradient(circle at 30% 35%, #0ff 0 3px, transparent 3.5px), radial-gradient(circle at 68% 45%, #08f 0 3px, transparent 3.5px), radial-gradient(circle at 46% 72%, #2c6 0 3px, transparent 3.5px), #000; }
.pt-sw-nogreen { background: radial-gradient(circle at 30% 35%, #f0f 0 3px, transparent 3.5px), radial-gradient(circle at 68% 45%, #f04 0 3px, transparent 3.5px), radial-gradient(circle at 46% 72%, #63f 0 3px, transparent 3.5px), #000; }
.pt-sw-noblue { background: radial-gradient(circle at 30% 35%, #ff0 0 3px, transparent 3.5px), radial-gradient(circle at 68% 45%, #f80 0 3px, transparent 3.5px), radial-gradient(circle at 46% 72%, #8d2 0 3px, transparent 3.5px), #000; }

/* Actions */
.pt-actions { display: grid; gap: 8px; padding-top: 18px; }
.pt-action {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: var(--pt-ink);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.pt-action:hover { border-color: #bba98d; background: #fffaf1; }
.pt-action.pt-primary { background: var(--pt-umber); border-color: var(--pt-umber); color: #fff; }
.pt-action.pt-primary:hover { background: var(--pt-umber-deep); }

.pt-keys dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13.5px; }
.pt-keys dt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--pt-umber); }
.pt-keys dd { margin: 0; }

.pt-drawer-foot { padding-top: 16px; font-size: 13.5px; color: #7b6d5a; }
.pt-drawer-foot p { margin: 0; }
.pt-drawer-foot a { color: var(--pt-umber) !important; font-weight: bold; text-decoration: none !important; }
.pt-drawer-foot a:hover { text-decoration: underline !important; }

/* Toast */
.pt-toast {
    position: absolute;
    left: 50%;
    bottom: 76px;
    max-width: calc(100% - 32px);
    transform: translate(-50%, 10px);
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(246, 242, 234, 0.95);
    color: var(--pt-ink);
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 6;
    text-align: center;
}
.pt-toast.pt-show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    .pt-drawer, .pt-bar, .pt-bigplay, .pt-toast { transition-duration: 0.01s; }
}

/* Wrapper page helpers (index.php) */
.pt-launch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    margin: 0.4em 0 0;
}
.pt-launch a {
    display: inline-block;
    padding: 0.45em 1em;
    border: 1px solid #c2b8a3;
    border-radius: 999px;
    font-size: 0.85em;
    color: #8b5e3c;
    background: #fff;
}
.pt-launch a:hover { background: #f4f1ec; }

@container (max-width: 600px) {
    .pt-hint { top: 38px; font-size: 14px; }
}

/* Camera flash when a screenshot is taken */
.pt-app::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 7;
}
.pt-app.pt-flash::after { animation: pt-flash 0.45s ease-out; }
@keyframes pt-flash { from { opacity: 0.55; } to { opacity: 0; } }

.pt-note-tight { margin: -8px 0 14px; }

/* Segmented choices (kaleidoscope, shape) */
.pt-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pt-choices button {
    flex: 1 1 auto;
    min-width: 44px;
    padding: 7px 10px;
    border: 1px solid var(--pt-line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--pt-ink);
    cursor: pointer;
}
.pt-choices button:hover { border-color: #bba98d; }
.pt-choices button[aria-checked="true"] { border-color: var(--pt-umber); background: var(--pt-umber); color: #fff; }
.pt-choices button:focus-visible { outline: 2px solid rgba(139, 94, 60, 0.6); outline-offset: 2px; }

/* Fixed centre of gravity (click) */
.pt-app.pt-pinned .pt-well { opacity: 0.7; }

/* Photosensitivity notice */
.pt-warning {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
    z-index: 8;
}
.pt-app.pt-warn .pt-warning { display: flex; }
.pt-app.pt-warn .pt-bigplay,
.pt-app.pt-warn .pt-bar,
.pt-app.pt-warn .pt-hint { display: none; }
.pt-warning-card {
    max-width: 440px;
    max-height: 100%;
    overflow-y: auto;
    padding: 20px 22px;
    border-radius: 12px;
    background: var(--pt-paper);
    color: var(--pt-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.pt-warning-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: normal; color: var(--pt-umber); }
.pt-warning-card p { margin: 0 0 10px; font-size: 14.5px; }
.pt-warning-card .pt-action { margin-top: 6px; }
@container (max-width: 420px) {
    .pt-warning-card { padding: 14px 16px; }
    .pt-warning-card p { font-size: 13.5px; }
}

.pt-thanks { margin-bottom: 8px !important; color: var(--pt-umber); font-weight: bold; }

/* Wrapper page: photosensitivity note */
.pt-photo-note {
    margin: 0.6em 0 0;
    padding: 0.5em 0.8em;
    border-left: 4px solid #c2b8a3;
    background: #f4f1ec;
    font-size: 0.8em;
    border-radius: 4px;
}
