/* Cedilla Studio — Phosphor (preview at /phosphor-test, since 23 Nov 2026; first built as "CRT"), old screen
   effect generator. Loaded after off-grid.css, which supplies the panel,
   stage, chips, sliders and sheets. This file swaps Off Grid's blue for a
   phosphor cyan and adds the few pieces Phosphor has of its own. Scoped under
   body.phosphor-page. */

body.phosphor-page {
  --blue: #1FB6FF;   /* accent: Off Grid's variable name, Phosphor's tube cyan */
  --pink: #3B6BFF;
  --cyan: #5CFFC4;
  --glow: rgba(31, 182, 255, .55);
  --wash: rgba(31, 182, 255, .09);
}
.phosphor-page .lab textarea:focus, .phosphor-page .lab select:focus { background: var(--wash); }
.phosphor-page .param input[type=range]:hover::-webkit-slider-thumb,
.phosphor-page .param input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--glow); }
.phosphor-page .lab .pill--glow:hover { box-shadow: 0 0 18px var(--glow), 0 0 40px rgba(31, 182, 255, .3); }
.phosphor-page .param[hidden] { display: none; }

/* The stage: the screen sits in the middle on a dark surround (phosphor.js sizes it) */
.phosphor-page .lab-stage { background: #050506; }
.phosphor-page .lab-stage canvas#labCanvas {
  inset: auto; left: 0; top: 0; width: 100px; height: 100px; touch-action: pan-y;
  border-radius: 10px; background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 24px 70px rgba(0,0,0,.7), 0 0 90px rgba(31, 182, 255, .07);
}
.phosphor-page .ph-nogl { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 40px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* [02] Picture: sample photos */
.phosphor-page .ph-demos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.phosphor-page .ph-demo {
  position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: #0c0c0f; color: var(--muted);
  font: inherit; font-size: 10px; line-height: 1.15;
}
.phosphor-page .ph-demo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.phosphor-page .ph-demo:hover { border-color: rgba(255,255,255,.4); }
.phosphor-page .ph-demo.is-on { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.phosphor-page .ph-upload-note { margin: 8px 0 16px; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.phosphor-page #labText { min-height: 62px; }

/* [04] Colour: the screen's own colours */
.phosphor-page .swatches { grid-template-columns: repeat(7, 1fr); }
.phosphor-page .ph-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.phosphor-page .ph-cols label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); cursor: pointer; }
.phosphor-page .ph-cols label[hidden] { display: none; }
.phosphor-page .ph-cols input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: transparent; padding: 3px; cursor: pointer; }
.phosphor-page .ph-cols input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.phosphor-page .ph-cols input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.phosphor-page .ph-cols input[type=color]::-moz-color-swatch { border: 0; border-radius: 7px; }
.phosphor-page #phTintField[hidden] { display: none; }

/* [07] Export */
.phosphor-page .ph-export-info { margin: 10px 0 12px; }
.phosphor-page .ph-export-info b { color: #fff; font-weight: 500; }
.phosphor-page #btnExportVideo { margin-top: 8px; }

/* Phones: the bar's round Upload key (lab-bar.js; the other keys' icons are in off-grid.css) */
@media (max-width: 860px) {
  .phosphor-page .lab-bar #btnUpload { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='14' rx='2.5'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='M4 17l4.8-4.6 3.4 3.2 3-2.8 4.8 4.4'/%3E%3C/svg%3E"); }
  .phosphor-page .lab-stage { height: 62vh; height: 62svh; min-height: 360px; }
}


/* "Beta", top left of the stage (the app is sold as a beta, 23 Nov 2026) */
.phosphor-page .ph-beta {
  position: absolute; left: 18px; top: 16px; z-index: 2; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(31, 182, 255, .55); color: #9fe3ff; background: rgba(31, 182, 255, .08);
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; pointer-events: auto; cursor: default;
}
.phosphor-page .lab-stage.is-clean .ph-beta, .phosphor-page .lab-stage.is-recording .ph-beta { display: none; }
@media (max-width: 860px) { .phosphor-page .ph-beta { left: 12px; top: 10px; } }

/* ---------- Pro and free-account popups, in the other apps' style ----------
   A banner across the top, edge to edge (made by _private/tools/phosphor/bake-banners.js:
   one word in five Pro recipes, and one in five free recipes). */
.phosphor-page .pro-sheet-card { box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 60px rgba(31, 182, 255, .16); }
.phosphor-page #proSheet .pro-sheet-card, .phosphor-page #joinSheet .pro-sheet-card { padding-top: 0; }
.phosphor-page .ph-pro-banner, .phosphor-page .join-banner {
  display: block; width: calc(100% + 52px); max-width: none; height: auto; aspect-ratio: 5 / 2; object-fit: cover;
  margin: 0 -26px 20px; border-radius: 19px 19px 0 0; background: #000;
}
.phosphor-page #proSheet .pro-sheet-x, .phosphor-page #joinSheet .pro-sheet-x {
  z-index: 1; background: rgba(10,10,12,.55); border-color: rgba(255,255,255,.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.phosphor-page #joinTitle { margin-bottom: 16px; }
.phosphor-page .pro-sheet-price s { margin-left: 4px; font-size: 14px; color: var(--faint); font-weight: 400; }
.phosphor-page .pro-sheet-code {
  margin: -10px 0 18px; padding: 8px 12px; border-radius: 10px; border: 1px dashed rgba(255,255,255,.25);
  font-size: 12.5px; color: var(--muted);
}
.phosphor-page .pro-sheet-code b { color: #fff; font-family: var(--mono); letter-spacing: .08em; font-weight: 500; }
.phosphor-page .lab .pill--pro { border-color: rgba(31, 182, 255, .7); box-shadow: 0 0 14px rgba(31, 182, 255, .35); }

/* Download menu: each item's name line stays on one line, with its tag
   ("1 free", "Pro", "Free account") pushed to the right edge (23 Nov 2026) */
.phosphor-page .lg-dl-name { flex-wrap: nowrap; white-space: nowrap; }
.phosphor-page .lg-dl-name .free-left, .phosphor-page .lg-dl-name .lg-pro { margin-left: auto; flex: none; }

/* The phone bar's save menu pills (#btnPngVideo, #btnPngHd; lab-guide.css already
   hides #btnPngLq, #btnPng and #btnPngHq): on computers the Download menu does their job */
@media (min-width: 861px) { .phosphor-page .lab-dock #btnPngVideo, .phosphor-page .lab-dock #btnPngHd { display: none; } }

/* ---------- Top bar as on Overprint (24 Nov 2026): icons, and one bright button at a time ----------
   Until the visitor makes it their own (body.ph-own), #btnUpload is the white button and Download steps
   back to an outline; then Download is the white one again. Phones keep their own bar and icons. */
.phosphor-page .lab .pill .ph-ico { flex: none; width: 13px; height: 13px; margin: -2px 7px -2px -1px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.phosphor-page .lab .pill .ph-ico--play { fill: currentColor; stroke-width: 1; }
.phosphor-page #btnPlay[aria-pressed="true"] .ph-ico--play, .phosphor-page #btnPlay[aria-pressed="false"] .ph-ico--pause { display: none; }
.lab-mob.phosphor-page .pill .ph-ico { display: none; }
@media (max-width: 860px) { .phosphor-page .lab .pill .ph-ico { display: none; } }
@media (min-width: 861px) {
  .phosphor-page .lab-dock .pill--glow, .phosphor-page .lab-dock .pill--glow:not(:hover) { border-color: transparent; }
  .phosphor-page:not(.ph-own) .lab-dock #btnUpload {
    font-weight: 600; color: #000; background: #fff; border-color: #fff; margin-right: 4px;
  }
  .phosphor-page:not(.ph-own) .lab-dock #btnUpload:hover {
    background: linear-gradient(135deg, var(--pink), var(--blue), var(--cyan)) border-box; border-color: transparent; color: #fff;
  }
  .phosphor-page:not(.ph-own) .lab .pill.lg-dl-btn {
    font-weight: 500; color: #fff; background: none; border-color: rgba(255, 255, 255, .24);
  }
  .phosphor-page:not(.ph-own) .lab .pill.lg-dl-btn:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .4); }
}
