/* Text art (textart.js): how a document looks, its effects, and the editor. Shared by MySpell and the forums.
   Colours, fonts and sizes go on through the CSSOM; this file holds only fixed classes. */

.ta-doc { overflow-wrap: anywhere; line-height: 1.45; min-width: 0; max-width: 100%; }
.ta-p { min-height: 1.2em; }
.ta-p[data-q] { margin-left: 4px; padding-left: 12px; border-left: 3px solid rgba(177, 140, 255, .7); opacity: .9; }
.ta-ascii { white-space: pre; overflow-x: auto; overflow-wrap: normal; font-family: Consolas, "Cascadia Mono", "DejaVu Sans Mono", Menlo, "IBM Plex Mono", ui-monospace, monospace; line-height: 1.05; font-variant-ligatures: none; font-size: 14px; tab-size: 4; }
.ta-ascii .ta-p { min-height: 1.05em; }
.ta-ascii .ta-p, .ta-ascii .ta-p * { font-family: inherit !important; letter-spacing: 0 !important; }   /* (Nov 4) every glyph the same width, so box and block art lines up */
.ta-l { display: inline-block; white-space: pre; }

/* effects. --ta-dur is the effect's length at its speed (textart.js sets it); the flashing ones (blink, colour cycle,
   neon flicker) are floored with max() so none can change 3 or more times a second, whatever the speed says:
   blink 2 changes a loop -> at least .7s; colour cycle 4 -> 1.4s; flicker 6 -> 2.1s. */
.ta-fx-rainbow, .ta-fx-gradient, .ta-fx-sparkle, .ta-bfx-rainbow, .ta-bfx-sparkle { -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; }
.ta-fx-rainbow, .ta-bfx-rainbow { background-image: linear-gradient(90deg, #ff4d6d, #ff9f1c, #ffe14d, #4dff88, #4dc3ff, #9b5cff, #ff4dd8, #ff4d6d); background-size: 300% 100%; animation: ta-slide var(--ta-dur, 4s) linear infinite; }
.ta-fx-gradient { background-image: linear-gradient(90deg, var(--ta-c1, #ff6ad5), var(--ta-c2, #8d62f2)); }
.ta-fx-glow, .ta-bfx-glow { text-shadow: 0 0 4px currentColor, 0 0 10px currentColor, 0 0 18px currentColor; }
.ta-fx-sparkle, .ta-bfx-sparkle { background-image: linear-gradient(100deg, var(--ta-c, #fff6c9) 0%, #fff 18%, #ff9de2 30%, #b8a6ff 45%, #9ff3ff 60%, #fff 75%, var(--ta-c, #fff6c9) 100%);
  background-size: 250% 100%; animation: ta-slide var(--ta-dur, 2.4s) linear infinite; filter: drop-shadow(0 0 4px rgba(255, 230, 255, .6)); }
.ta-fx-shake { display: inline-block; animation: ta-shake var(--ta-dur, .35s) steps(2) infinite; }
.ta-fx-wave .ta-l, .ta-bfx-wave .ta-l { animation: ta-wave var(--ta-dur, 1.4s) ease-in-out infinite; }
.ta-fx-bounce .ta-l, .ta-bfx-bounce .ta-l { animation: ta-bounce var(--ta-dur, .9s) ease-in-out infinite; }
.ta-fx-blink { animation: ta-blink max(var(--ta-dur, 1.1s), .7s) steps(1) infinite; }
.ta-fx-cycle, .ta-bfx-cycle { animation: ta-cycle max(var(--ta-dur, 3s), 1.4s) steps(1) infinite; }
.ta-fx-pulse, .ta-bfx-pulse { display: inline-block; animation: ta-pulse-grow var(--ta-dur, 1.6s) ease-in-out infinite; }
.ta-bfx-pulse { display: block; }
.ta-fx-flicker, .ta-bfx-flicker { animation: ta-flicker max(var(--ta-dur, 2.4s), 2.1s) linear infinite; text-shadow: 0 0 4px currentColor, 0 0 12px currentColor; }
.ta-fx-typewriter .ta-l, .ta-bfx-typewriter .ta-l { animation: ta-type .12s steps(1) backwards; }
.ta-fx-marquee { display: inline-block; padding-left: 100%; animation: ta-marquee var(--ta-dur, 8s) linear infinite; }
.ta-fx-marquee.ta-dir-right { animation-direction: reverse; }
.ta-bfx-marquee > .ta-p { display: inline-block; padding-left: 100%; animation: ta-marquee var(--ta-dur, 8s) linear infinite; }
.ta-bfx-marquee.ta-dir-right > .ta-p { animation-direction: reverse; }
.ta-fx-fadein, .ta-bfx-fadein { animation: ta-fade var(--ta-dur, 1.2s) ease-out backwards; }
.ta-bfx-pulse, .ta-bfx-fadein, .ta-bfx-flicker, .ta-bfx-cycle { transform-origin: center; }
@keyframes ta-slide { to { background-position: -300% 0; } }
@keyframes ta-shake { 0% { transform: translate(1px, -1px) rotate(-1deg); } 50% { transform: translate(-1px, 1px) rotate(1deg); } }
@keyframes ta-wave { 50% { transform: translateY(-.25em); } }
@keyframes ta-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-.35em); } 60% { transform: translateY(.05em); } }
@keyframes ta-blink { 50% { opacity: 0; } }
@keyframes ta-pulse { 50% { opacity: .55; } }
@keyframes ta-pulse-grow { 50% { opacity: .75; transform: scale(1.06); } }
@keyframes ta-cycle { 0% { color: var(--ta-k1); } 25% { color: var(--ta-k2); } 50% { color: var(--ta-k3); } 75% { color: var(--ta-k4); } }
@keyframes ta-flicker { 0%, 18%, 22%, 26%, 54%, 58%, 100% { opacity: 1; } 20%, 24%, 56% { opacity: .3; text-shadow: none; } }
@keyframes ta-type { from { opacity: 0; } }
@keyframes ta-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes ta-fade { from { opacity: 0; transform: translateY(.3em); } }

/* forum posts and signatures: the loud ones toned down (no flicker or strobe, slower cycles); signatures capped in height */
.ta-sig { max-height: 120px; overflow: hidden; font-size: 14px; }
.ta-sig .ta-fx-blink { animation: ta-pulse 2.4s ease-in-out infinite; }
.ta-sig .ta-fx-shake { animation: none; }
.ta-post .ta-fx-flicker, .ta-sig .ta-fx-flicker, .ta-post.ta-bfx-flicker, .ta-sig.ta-bfx-flicker { animation: ta-pulse 3s ease-in-out infinite; }
.ta-post .ta-fx-cycle, .ta-sig .ta-fx-cycle, .ta-post.ta-bfx-cycle, .ta-sig.ta-bfx-cycle { animation-duration: max(var(--ta-dur, 3s), 3s); }

/* the editor's own surface: effects shown still (the preview moves) */
.ta-edit .ta-fx-shake, .ta-edit .ta-fx-blink, .ta-surface .ta-fx-shake, .ta-surface .ta-fx-blink, .ta-surface .ta-fx-flicker, .ta-surface .ta-fx-cycle,
  .ta-surface .ta-fx-pulse, .ta-surface .ta-fx-marquee, .ta-surface .ta-fx-fadein { animation: none; padding-left: 0; text-decoration: underline wavy rgba(255, 106, 213, .7); }
.ta-surface .ta-fx-cycle { color: var(--ta-k1); }
.ta-surface .ta-fx-wave, .ta-surface .ta-fx-bounce, .ta-surface .ta-fx-typewriter { text-decoration: underline dotted rgba(255, 106, 213, .8); }

/* nobody who asked for less motion gets any */
@media (prefers-reduced-motion: reduce) {
  .ta-fx-rainbow, .ta-fx-sparkle, .ta-fx-shake, .ta-fx-wave .ta-l, .ta-fx-bounce .ta-l, .ta-fx-blink, .ta-sig .ta-fx-blink,
  .ta-fx-cycle, .ta-fx-pulse, .ta-fx-flicker, .ta-fx-typewriter .ta-l, .ta-fx-marquee, .ta-fx-fadein,
  .ta-bfx-rainbow, .ta-bfx-sparkle, .ta-bfx-wave .ta-l, .ta-bfx-bounce .ta-l, .ta-bfx-cycle, .ta-bfx-pulse, .ta-bfx-flicker, .ta-bfx-typewriter .ta-l,
  .ta-bfx-marquee > .ta-p, .ta-bfx-fadein { animation: none !important; }
  .ta-fx-marquee, .ta-bfx-marquee > .ta-p { padding-left: 0 !important; }
  .ta-fx-cycle, .ta-bfx-cycle { color: var(--ta-k1); }
}

/* ---- the editor ---- */
.ta-editor { display: grid; gap: 6px; }
.ta-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .1); }
.ta-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; padding-right: 6px; border-right: 1px solid rgba(255, 255, 255, .1); }
.ta-group:last-child { border-right: 0; }
.ta-bar button, .ta-bar select, .ta-bar label { font: inherit; font-size: 13px; min-height: 28px; padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06); color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; width: auto; }
.ta-bar button:hover, .ta-bar label:hover { border-color: #ff6ad5; }
.ta-bar input[type="color"] { width: 22px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.ta-swatch { width: 18px !important; min-height: 18px !important; height: 18px; padding: 0 !important; border-radius: 50% !important; }
.ta-recent { display: inline-flex; gap: 2px; }
.ta-ascii-toggle input { width: auto !important; }
.ta-symbols { display: flex; flex-wrap: wrap; gap: 2px; max-height: 160px; overflow: auto; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.ta-symbols button { min-width: 30px; height: 28px; padding: 0 6px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; background: rgba(255, 255, 255, .05); color: inherit; cursor: pointer; font-size: 15px; }
.ta-symbols button:hover { border-color: #ff6ad5; }
.ta-surface { min-height: 140px; max-height: 520px; overflow: auto; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .35); outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.ta-surface:focus { border-color: #ff6ad5; }
.ta-surface.ta-ascii { white-space: pre; overflow-wrap: normal; font-family: Consolas, "Cascadia Mono", "DejaVu Sans Mono", Menlo, "IBM Plex Mono", ui-monospace, monospace; line-height: 1.05; font-variant-ligatures: none; font-size: 14px; }
.ta-count { margin: 0; font-size: 12px; opacity: .7; }
.ta-count.ta-over { color: #ff8a8a; opacity: 1; font-weight: 700; }
.ta-preview-label { margin: 6px 0 2px; font-size: 12px; opacity: .7; }
.ta-preview { padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, .2); }
/* (Nov 4) Dropdown lists drew pale text on the browser's white menu (they looked greyed out): dark menus, readable rows */
select { color-scheme: dark; }
select option { background-color: #1d1420; color: #f3e3c8; }
select option:disabled { color: #8a7f8c; }
