/* Literary Canvas — full-screen immersive viewer for written work */

.lc-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lc-layer.lc-active {
  opacity: 1;
  pointer-events: auto;
}

/* Background layer */
.lc-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #FFFDF7;
}

/* Sprites layer */
.lc-sprites {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Column wrapper — scrollable container */
.lc-column-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0) 0;
}
/* Safe centering: margin:auto on the child avoids the flex overflow-clip bug */

/* Text column */
.lc-text-column {
  width: 390px;
  max-width: 100%;
  padding: 48px 24px 80px;
  position: relative;
}
.lc-column-wrap.lc-centered .lc-text-column {
  margin-top: auto;
  margin-bottom: auto;
}

/* Markdown body typography */
.lc-body p {
  margin: 0 0 1em;
}
.lc-body h1, .lc-body h2, .lc-body h3 {
  margin: 1.4em 0 0.6em;
  font-weight: 600;
}
.lc-body h1 { font-size: 1.6em; }
.lc-body h2 { font-size: 1.3em; }
.lc-body h3 { font-size: 1.1em; }
.lc-body blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid currentColor;
  opacity: 0.7;
}
.lc-body ul, .lc-body ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.lc-body li {
  margin-bottom: 0.3em;
}
.lc-body hr {
  border: none;
  border-top: 1px solid currentColor;
  opacity: 0.15;
  margin: 2em 0;
}
.lc-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Close button */
.lc-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 10001;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(128, 128, 128, 0.25);
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
}
.lc-close:hover {
  background: rgba(128, 128, 128, 0.4);
}

/* Scroll indicator — thin vertical bar on right */
.lc-scroll-indicator {
  position: fixed;
  right: 4px;
  top: 0;
  width: 3px;
  height: 0%;
  background: currentColor;
  opacity: 0.12;
  z-index: 10001;
  transition: height 0.1s ease-out, opacity 0.3s;
  border-radius: 2px;
  pointer-events: none;
}
.lc-scroll-indicator.lc-scrolled {
  opacity: 0.2;
}

/* Piece indicator dots */
.lc-dots {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
.lc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
  transition: opacity 0.2s;
}
.lc-dot-active {
  opacity: 0.7;
}

/* Echo counter */
.lc-echo-counter {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 10001;
  font-size: 11px;
  opacity: 0.3;
  pointer-events: none;
}

/* Echo picker */
.lc-echo-picker {
  display: flex;
  gap: 4px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 6px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: lcPickerIn 0.15s ease-out;
}
@keyframes lcPickerIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lc-echo-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.1s, background 0.1s;
  line-height: 1;
}
.lc-echo-btn:hover {
  transform: scale(1.2);
  background: rgba(255,255,255,0.1);
}
.lc-echo-btn:active {
  transform: scale(0.95);
}

/* Echo float-up animation */
.lc-echo-float {
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Writing block card in canvas view */
.canvas-block-writing:hover {
  border-color: rgba(255,255,255,0.15) !important;
}

/* Mobile adjustments */
@media (max-width: 420px) {
  .lc-text-column {
    width: 100%;
    padding: 32px 20px 64px;
  }
}
