/* 03 Play (js/play.js): Lantern on Play in the app's Play pane, then the Artifacts gallery's tiles. Surfaces are the
   app's cool greys (cloudflare/web/src/vendor/canvas/index.css); the brand's vermilion is the person's colour. */

.pl {
  --g975: #05070a; --g950: #0b0e14; --g940: #10131a; --g925: #171a22; --g900: #21252f; --g800: #2c313f; --g700: #383f50;
  --g600: #4b5468; --g500: #7e8a9e; --g400: #a3b0c4; --g200: #dce3ee;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; font-size: 12px; color: var(--g200);
}
.pl > * { min-width: 0; }
.pl .mono { font-family: var(--font-mono); font-size: inherit; }

/* The pane */
.pl-win {
  background: var(--g950); border: 1px solid var(--g800); border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.pl-tabs {
  display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 8px; background: var(--g975);
  border-bottom: 1px solid var(--g900); overflow: hidden; white-space: nowrap;
}
.pl-tab { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; color: var(--g500); font-size: 12px; }
.pl-tab-on { background: var(--g925); color: #fff; box-shadow: inset 0 0 0 1px var(--g800); }
.pl-tri { width: 0; height: 0; border: 4px solid transparent; border-left: 6px solid var(--accent); border-right: 0; margin-right: -1px; }
.pl-vbadge { font: 600 9.5px/1 var(--font-mono); font-style: normal; padding: 2px 4px; border-radius: 3px; color: var(--g400); background: var(--g900); }

.pl-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px; background: var(--g950); border-bottom: 1px solid var(--g900); }
.pl-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 7px; background: var(--g900); }
.pl-seg-b {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border: 0; border-radius: 5px;
  background: none; color: var(--g400); font-size: 12px; font-weight: 550; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.pl-seg-b:hover { color: #fff; }
.pl-seg-b[aria-checked="true"] { background: var(--g700); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.pl-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 6px var(--ember); }
.pl-ahead .pl-dot { display: inline-block; }
.pl-ping .pl-dot { animation: pl-ping 0.9s ease-out 2; }
@keyframes pl-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ember) 80%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

.pl-addr {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 7px;
  background: var(--g940); border: 1px solid var(--g900); font-size: 12px; color: var(--g500);
}
.pl-addr .pl-ic { color: var(--g500); }
.pl-host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-host b { font-weight: 500; color: var(--g200); }
[data-side="draft"] .pl-host b { color: var(--paper); }
.pl-rev { margin-left: auto; flex: none; font-size: 10.5px; color: var(--g500); padding: 2px 5px; border-radius: 4px; background: var(--g900); }

.pl-ic { width: calc(var(--w) * 2px); height: calc(var(--h) * 2px); flex: none; color: currentColor; }
.pl-tool {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid var(--g800);
  border-radius: 7px; background: var(--g925); color: var(--g200); font-size: 12px; font-weight: 550; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.pl-tool:hover { background: var(--g900); border-color: var(--g700); }
.pl-tool .pl-ic { width: 14px; height: 14px; }

/* Publish is the page's primary button: a person's mark on the paper face. */
.pl-publish { flex: none; font-size: 12.5px; margin-right: 3px; }
.pl-publish > span { padding: 7px 12px 7px 10px; gap: 7px; width: 124px; justify-content: center; }
.pl-publish .pl-person { color: var(--accent); }
.pl-publish:disabled { cursor: default; }
.pl-publish:disabled > span { background: var(--g900); color: var(--g500); transform: none; }
.pl-publish:disabled::before { background: var(--g800); }
.pl-publish:disabled .pl-person { color: var(--g600); }
.pl-publish.pl-busy > span { background: var(--paper); color: var(--night); }
.pl-publish.pl-busy::before { background: var(--accent); }
.pl-publish.pl-busy .pl-person { color: var(--accent); }
.pl-publish.pl-busy .pl-pub-l::after { content: ""; display: inline-block; width: 12px; text-align: left; animation: pl-dots 0.9s steps(4) infinite; }
@keyframes pl-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* The game */
.pl-stage {
  position: relative; overflow: hidden; background: #05070f; outline: none; cursor: crosshair;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.pl-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.15s; }
.pl-stage:focus-visible::after, .pl-stage:focus::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.pl-game { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pl-boot .pl-game { animation: pl-boot 0.42s steps(5) 1; }
@keyframes pl-boot { 0% { opacity: 0; filter: brightness(2.5); } 40% { opacity: 1; } 100% { filter: none; } }
.pl-reload .pl-game { animation: pl-reload 0.5s steps(3) 1; }
@keyframes pl-reload { 0% { filter: brightness(1.8) saturate(0.6); } 100% { filter: none; } }

.pl-foot {
  display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 0 12px; border-top: 1px solid var(--g900);
  background: var(--g950); font: 11.5px/1.3 var(--font-mono); color: var(--g400);
}
.pl-act { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.pl-act .led { width: 6px; height: 6px; }
.pl-act-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-act-t b { color: var(--c-text, var(--g200)); font-weight: 600; }
.pl-sep { color: var(--g600); }
.pl-ago { flex: none; color: var(--g600); }
.pl-flash .pl-act-t { animation: pl-in 0.5s steps(4) 1; }
.pl-flash .led { animation: pl-led 1.2s ease-out 1; }
@keyframes pl-in { 0% { opacity: 0; transform: translateY(5px); } 100% { opacity: 1; transform: none; } }
@keyframes pl-led { 0% { box-shadow: 0 0 0 0 var(--c); } 30% { box-shadow: 0 0 10px 3px var(--c); } 100% { box-shadow: 0 0 8px var(--c); } }
.pl-hint { flex: none; display: flex; align-items: center; gap: 6px; color: var(--g600); }
.pl-k { padding: 2px 5px; border: 1px solid var(--g800); border-radius: 4px; color: var(--g500); font-size: 10.5px; transition: color 0.15s, border-color 0.15s; }
.pl-stage:focus ~ .pl-foot .pl-k { color: var(--paper); border-color: var(--g600); }
@media (pointer: coarse) { .pl-k { display: none; } .pl-or::before { content: "tap to walk"; } .pl-or { font-size: 0; } .pl-or::before { font-size: 11px; } }

/* The Artifacts gallery */
.pl-gal { background: var(--g950); border: 1px solid var(--g800); border-radius: 12px; padding: 12px 12px 14px; }
.pl-gal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; }
.pl-gal-h b { color: #fff; font-weight: 600; }
.pl-count { font-size: 10.5px; color: var(--g500); padding: 2px 5px; border-radius: 4px; background: var(--g900); }
.pl-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pl-tile { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.pl-poster {
  position: relative; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--g940);
  border: 1px solid var(--g900); transition: border-color 0.2s;
}
.pl-pc { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pl-over {
  position: absolute; top: 5px; display: inline-flex; align-items: center; gap: 4px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 10px; line-height: 14px; white-space: nowrap;
}
.pl-kind { left: 5px; }
.pl-view { left: 5px; top: 25px; color: var(--mint); }
.pl-dur, .pl-tris { top: auto; bottom: 5px; right: 5px; font-size: 9.5px; color: var(--g200); }
.pl-tdot { display: none; width: 5px; height: 5px; margin-left: 5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 5px var(--ember); vertical-align: 1px; }
.pl-tile-ahead .pl-tdot { display: inline-block; }
.pl-tile-ahead .pl-poster { border-color: var(--g700); }
.pl-vplay { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgba(8, 10, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.25); }
.pl-vplay::after { content: ""; position: absolute; left: 8px; top: 6px; border: 4.5px solid transparent; border-left: 7px solid var(--paper); border-right: 0; }
.pl-tile figcaption { display: grid; gap: 1px; min-width: 0; }
.pl-tile figcaption b { font-size: 12.5px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-by { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--g500); overflow: hidden; white-space: nowrap; }
.pl-by .led { width: 5px; height: 5px; box-shadow: none; }
.pl-st { color: var(--g400); }
.pl-when { margin-left: auto; padding-left: 3px; }

@media (max-width: 760px) {
  .pl-tab-x { display: none; }
  .pl-bar { flex-wrap: wrap; row-gap: 8px; }
  .pl-seg { order: 1; }
  .pl-tool { order: 2; margin-left: auto; padding: 0 9px; }
  .pl-tool-l { display: none; }
  .pl-publish { order: 3; }
  .pl-addr { order: 4; flex-basis: 100%; }
  .pl-hint .pl-k:nth-child(2) { display: none; }
  .pl-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 12px; gap: 10px; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .pl-tiles::-webkit-scrollbar { display: none; }
  .pl-tile { flex: none; width: 136px; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-boot .pl-game, .pl-reload .pl-game, .pl-flash .pl-act-t, .pl-flash .led, .pl-ping .pl-dot, .pl-publish.pl-busy .pl-pub-l::after { animation: none; }
  .pl-publish.pl-busy .pl-pub-l::after { content: "…"; }
}
