/* ═══ secrets.css — secrets under pressure: three glass tubes ═══
   Data ×3: { name, exposure (0..120), leaked, owned }.  Markup (see skeletons/secrets.html):

   <div class="secrets" role="list">
     <div class="tube" role="listitem" data-state="ok|danger|leaked" data-owned="false" style="--lv:.42">   <!-- --lv = exposure/120, clamp 0..1 -->
       <div class="tube-name">The Letters</div>
       <div class="tube-glass"><i class="tube-level"></i><i class="tube-mark"></i><i class="tube-crack"></i></div>
       <div class="tube-read">51</div>
     </div>
   </div>
   data-state: leaked → shattered; else danger when exposure ≥ 85 (hairline crack + slow pulse). Set it from JS.
   The only motion on change: level eases to its new height over 900ms, then still. Nothing bounces. */

.secrets { --danger: .7083; /* 85/120 */ display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 10px 10px; border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 90, 95, .08), transparent 60%), linear-gradient(180deg, rgba(14, 18, 40, .9), rgba(6, 8, 18, .96)); border: 1px solid rgba(255, 255, 255, .07); }
.tube { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.tube-name { font: 700 9.5px/1.25 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #cfc6ad; text-align: center; min-height: 2.5em; display: flex; align-items: flex-end; max-width: 100%; }
.tube[data-state="danger"] .tube-name { color: #ff8a8e; }
.tube[data-state="leaked"] .tube-name { color: #6f7390; text-decoration: line-through; text-decoration-color: #ff5a5f; text-decoration-thickness: 2px; }
.tube[data-owned="true"] .tube-name::after { display: inline-block; content: " · OWNED"; color: #d4af37; letter-spacing: .12em; white-space: nowrap; }

.tube-glass { position: relative; width: 46px; height: 132px; border-radius: 23px 23px 18px 18px; overflow: hidden; isolation: isolate;
  background: linear-gradient(90deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 30%, rgba(255, 255, 255, .02) 70%, rgba(255, 255, 255, .09)), rgba(8, 11, 26, .85);
  border: 1.5px solid rgba(190, 205, 255, .28); box-shadow: inset 0 0 14px rgba(0, 0, 0, .8), 0 8px 18px -10px #000; }
.tube-glass::after { content: ""; position: absolute; left: 7px; top: 10px; bottom: 14px; width: 4px; border-radius: 4px; background: linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .03)); z-index: 4; pointer-events: none; } /* glass glint */

.tube-level { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; z-index: 1; transform-origin: bottom; transform: scaleY(var(--lv, 0));
  background: linear-gradient(90deg, #5c0a12, #b3121f 40%, #8d0d18 70%, #4a070d); transition: transform .9s cubic-bezier(.3, .6, .2, 1); }
.tube-level::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(#ff6a72, #b3121f); opacity: .9; } /* viscous meniscus */
/* the danger line at 85 */
.tube-mark { position: absolute; left: 0; right: 0; bottom: calc(var(--danger) * 100%); height: 0; z-index: 3; border-top: 1.5px dashed rgba(255, 210, 120, .75); }
.tube-mark::after { content: ""; position: absolute; right: 3px; top: -5px; width: 0; height: 0; border: 3px solid transparent; border-right-color: #ffd479; }

.tube-read { font: 700 12px/1 var(--serif); color: #8b93b2; font-variant-numeric: tabular-nums; }
.tube[data-state="danger"] .tube-read { color: #ff8a8e; }

/* ≥85: hairline crack + slow pulse */
.tube-crack { position: absolute; inset: 0; z-index: 5; opacity: 0; pointer-events: none;
  background: rgba(255, 235, 235, .85);
  clip-path: polygon(58% 6%, 60% 6%, 54% 20%, 59% 21%, 50% 36%, 53% 37%, 45% 52%, 49% 53%, 41% 66%, 43% 67%, 38% 80%, 36% 79%, 40% 66%, 38% 65%, 46% 53%, 43% 52%, 51% 37%, 48% 36%, 56% 21%, 53% 20%); }
.tube[data-state="danger"] .tube-crack { opacity: .9; transition: opacity .9s; }
.tube[data-state="danger"] .tube-glass { border-color: rgba(255, 110, 118, .55); animation: tube-throb 3.6s ease-in-out infinite; }
@keyframes tube-throb { 0%, 100% { box-shadow: inset 0 0 14px rgba(0, 0, 0, .8), 0 8px 18px -10px #000, 0 0 0 rgba(255, 60, 70, 0); } 50% { box-shadow: inset 0 0 14px rgba(0, 0, 0, .8), 0 8px 18px -10px #000, 0 0 18px rgba(255, 60, 70, .45); } }
/* box-shadow pulse is a paint-only glow; the transform/opacity rule applies to movement, and this never moves */

/* leaked: shattered — jagged outline, level gone */
.tube[data-state="leaked"] .tube-glass { height: 132px; border-color: rgba(190, 205, 255, .5); opacity: .9; background: linear-gradient(90deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 40%, rgba(255,255,255,.16)), #1b2040; box-shadow: inset 0 0 0 2px rgba(255, 90, 95, .35);
  clip-path: polygon(8% 4%, 30% 0, 41% 9%, 52% 2%, 71% 8%, 92% 0, 100% 22%, 91% 31%, 100% 46%, 86% 58%, 97% 71%, 80% 78%, 92% 100%, 63% 91%, 50% 100%, 34% 90%, 14% 100%, 0 78%, 12% 66%, 2% 50%, 14% 38%, 0 24%); }
.tube[data-state="leaked"] .tube-level, .tube[data-state="leaked"] .tube-mark, .tube[data-state="leaked"] .tube-crack { opacity: 0; transform: scaleY(0); }
.tube[data-state="leaked"] .tube-read::after { content: "LEAKED"; color: #ff5a5f; letter-spacing: .14em; font: 800 9px var(--sans); }
.tube[data-state="leaked"] .tube-read { font-size: 0; }

@media (prefers-reduced-motion: reduce) { .tube-level { transition: none; } .tube[data-state="danger"] .tube-glass { animation: none; box-shadow: inset 0 0 14px rgba(0,0,0,.8), 0 0 14px rgba(255,60,70,.4); } .tube[data-state="danger"] .tube-crack { transition: none; } }
.tube[data-state="leaked"] .tube-name::after { content: none; }
