/* Shared glitch/effect stylesheet — started here, extended by later sessions. */
.glitch-text { position: relative; display: inline-block; white-space: pre-wrap; will-change: transform; }
.glitch-text .ghost { position: absolute; left: 0; top: 0; pointer-events: none; }
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.screen-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ── CRT glass (SESSION-08, enhanced) — barrel curvature + aperture grille +
   scanlines + refresh roll + reflection over a lightened vignette. Built by
   crtShadowOverlay.js; `.layer` lives in base.css. A deliberate brightness /
   old-monitor-look upgrade (user directive) over the darker Dart reference. ── */
@keyframes crt-pulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 0.92; } }
@keyframes crt-roll  { 0% { transform: translateY(-40%); } 100% { transform: translateY(430%); } }

.crt-glass > div { position: absolute; inset: 0; }
/* Canvas is a replaced element: inset:0 alone won't stretch it, so fill explicitly. */
canvas.layer { width: 100%; height: 100%; display: block; }

/* Barrel curvature — rounded tube corners + a soft, corner-weighted glass bow.
   Radial only (no uniform inset-shadow) so the falloff reads round, never as a
   straight frame; darkening stays in the outer ~25% and out of the content. */
.crt-curvature {
  border-radius: clamp(12px, 3.4vmin, 34px);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.4);   /* thin glass-edge line only */
  background: radial-gradient(ellipse farthest-corner at 50% 50%,
    transparent 62%, rgba(0,0,0,0.09) 85%, rgba(0,0,0,0.3) 100%);
}

/* Aperture grille — vertical R/G/B phosphor triads (screen-blended, adds glow not gloom). */
.crt-grille {
  background: repeating-linear-gradient(90deg,
    rgba(255,0,0,0.07) 0px, rgba(255,0,0,0.07) 1px,
    rgba(0,255,0,0.06) 1px, rgba(0,255,0,0.06) 2px,
    rgba(0,90,255,0.07) 2px, rgba(0,90,255,0.07) 3px);
  mix-blend-mode: screen; opacity: 0.5;
}

/* Fine static scanlines — the drifting canvas scanline handles motion; this is the texture. */
.crt-fine-scan {
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,0.10) 0px, rgba(0,0,0,0.10) 1px,
    transparent 1px, transparent 3px);
}

/* Refresh roll — a soft bright bar drifting slowly down the tube. */
.crt-roll {
  top: 0; bottom: auto; height: 28%;
  background: linear-gradient(to bottom, transparent, rgba(196,214,255,0.05), transparent);
  mix-blend-mode: screen; animation: crt-roll 7s linear infinite;
}

/* Glass sheen — soft reflection near the top of the tube. */
.crt-reflection {
  background: radial-gradient(ellipse 70% 42% at 50% 7%,
    rgba(255,255,255,0.07), transparent 60%);
  mix-blend-mode: screen;
}

/* Corner vignette — ONE rounded radial (was 8 straight edge bands that read as a
   cross/frame). Elliptical + farthest-corner → darkening hugs the corners, edge
   midpoints stay light, center is fully clear. Gently pulses. */
.crt-vignette {
  background: radial-gradient(ellipse farthest-corner at 50% 50%,
    transparent 0%, transparent 66%, rgba(0,0,0,0.12) 85%, rgba(0,0,0,0.4) 100%);
  animation: crt-pulse 4s ease-in-out infinite;
}

/* Pull screen (SESSION-09) */
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes shimmer { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
.pull-header { animation: drift 8s ease-in-out infinite; width: 100%; }
.shimmer { animation: shimmer 6s ease-in-out infinite; }
.spread-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pull-chip { padding: 12px 20px; border: 2px solid rgba(68,255,255,0.27); border-radius: 4px;
  background: transparent; cursor: pointer; user-select: none; }
.pull-chip.selected { border-color: #44FFFF; background: rgba(68,255,255,0.08); box-shadow: 0 0 12px rgba(68,255,255,0.2); }
.intent-wrap { width: 100%; max-width: 320px; padding: 8px 12px;
  border: 1px solid rgba(68,255,255,0.2); border-radius: 4px; }
.intent-field { width: 100%; background: transparent; border: none; outline: none;
  font-family: 'Courier New', ui-monospace, monospace; font-size: 13px; letter-spacing: 1px; color: rgba(68,255,255,0.8); }
.intent-field::placeholder { color: rgba(68,255,255,0.2); letter-spacing: 2px; }
.pull-btn { padding: clamp(14px, 2.6vh, 24px) clamp(30px, 6vw, 48px); background: rgba(255,68,255,0.05);
  border: 3px solid rgba(255,68,255,0.6); border-radius: 6px; box-shadow: 0 0 12px rgba(255,68,255,0.15);
  cursor: pointer; user-select: none; }
.history-btn { padding: 12px 22px; border: 1px solid rgba(68,255,255,0.33); border-radius: 4px; cursor: pointer; user-select: none; }
.reset-btn { padding: 14px 28px; border: 2px solid #555555; border-radius: 4px;
  box-shadow: 0 0 8px rgba(153,153,153,0.1); cursor: pointer; user-select: none; }
.pull-bottom-bar { position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; padding: 10px 0 50px;
  pointer-events: none; background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.15)); }

/* CardFace (SESSION-11) — width lives in responsive.css (.card) */
.card { position: relative; margin-inline: auto; transform-origin: center; }
.card-outer-glow { position: absolute; inset: -14px; border-radius: 12px; pointer-events: none; }
.card-border-glow { position: absolute; inset: -2px; border-radius: 10px; pointer-events: none; }
.card-body { position: relative; border-radius: 10px; padding: 22px 20px; overflow: hidden; }
.card-content { display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.card-scanline { position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; }
.card-glitch-bar { position: absolute; left: 0; right: 0; pointer-events: none; }
.card-noise-line { position: absolute; left: 4px; right: 4px; text-align: center; white-space: nowrap;
  overflow: hidden; pointer-events: none; font-family: 'Courier New', ui-monospace, monospace; font-size: 8px; letter-spacing: 1px; }
.card-glyph { animation: glyph-pulse 3s linear infinite alternate; }
@keyframes glyph-pulse { from { opacity: 0.85; filter: brightness(1); } to { opacity: 1; filter: brightness(1.3); } }
@keyframes card-entrance {
  0%   { transform: scaleY(0); filter: blur(10px) brightness(2); }
  40%  { transform: scaleY(1.02); }
  70%  { filter: blur(0) brightness(1.3); }
  100% { transform: scaleY(1); filter: blur(0) brightness(1); }
}
.card-entering { animation: card-entrance 800ms ease-out forwards; }

/* CardReading + multi-card tabs (SESSION-12) */
.card-tab { padding: 8px 14px; border: 2px solid rgba(255,68,255,0.27); border-radius: 4px;
  background: transparent; cursor: pointer; user-select: none; }
.card-tab.selected { border-color: #FF44FF; background: rgba(255,68,255,0.1); }
.card-reading { width: 100%; max-width: 340px; margin-inline: auto; padding-top: 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.wisdom-block { cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.wisdom-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; }
.wisdom-section { padding: 3px 0; display: flex; flex-direction: column; align-items: center; }
.reading-text { margin-top: 18px; margin-bottom: 32px; white-space: pre-line;
  font-family: 'Courier New', ui-monospace, monospace; font-size: 15px; font-weight: bold;
  line-height: 2; color: #fff; text-align: center; }
.action-btn { padding: 12px 22px; border: 2px solid; border-radius: 4px; cursor: pointer; user-select: none; }

/* History / SavedReadings (SESSION-14) */
.history-overlay { position: absolute; inset: 0; overflow: hidden; z-index: 20; }
.history-content { position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.history-header { position: relative; padding: 24px 16px 16px; display: flex; align-items: center; justify-content: center; }
.history-back { position: absolute; left: 8px; padding: 8px; cursor: pointer; user-select: none; }
.history-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: min(100%, 34rem); margin-inline: auto; padding: 8px 16px 32px; }
.history-row { display: flex; align-items: center; gap: 14px; margin: 6px 0; padding: 14px 16px;
  background: rgba(255,255,255,0.05); border: 1px solid; border-radius: 6px; cursor: pointer; user-select: none; }
.history-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.history-dt { display: flex; flex-direction: column; align-items: flex-end; }
.history-del { padding: 8px; cursor: pointer; user-select: none; }

/* About screen (about-page) — overlay frame reuses .history-* chrome */
.about-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: min(100%, 68rem); margin-inline: auto; padding: 8px clamp(16px, 5vw, 32px) 48px; }
.about-lead { max-width: 42rem; margin: 4px auto 24px; line-height: 1.9; text-align: center; }
/* Step cards flow into as many columns as fit (1 on phones → up to 3 on desktop),
   filling the wide-screen margins instead of one lone narrow column. */
.about-steps { display: grid; gap: 18px; margin: 0 0 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.about-step { padding: 16px 18px; border: 1px solid rgba(68,255,255,0.18);
  border-radius: 6px; background: rgba(255,255,255,0.02); }
.about-step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.about-step-body { text-align: left; }
.about-closing { max-width: 44rem; margin: 8px auto 28px; text-align: center; }
.about-github { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 8px 0 12px; }
.about-github-btn { padding: 14px 30px; background: rgba(255,68,255,0.05);
  border: 2px solid rgba(255,68,255,0.6); border-radius: 6px; box-shadow: 0 0 12px rgba(255,68,255,0.15);
  cursor: pointer; user-select: none; }
/* Idle-screen entry button (wired in SESSION-02) — twin of .history-btn */
.about-btn { padding: 12px 22px; border: 1px solid rgba(68,255,255,0.33); border-radius: 4px; cursor: pointer; user-select: none; }
