/* creature.space — la cornice è silenziosa: il quadro è vivo. */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #1a1622;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

/* ---- testata ---- */

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  pointer-events: none;
  z-index: 5;
}

h1 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}

#info-btn {
  pointer-events: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 16, 28, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s;
}
#info-btn:hover { background: rgba(20, 16, 28, 0.5); transform: scale(1.08); }

/* ---- timeline ---- */

#timeline {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  user-select: none;
}

.tl-label {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.tl-day {
  font-size: 12px;
  letter-spacing: 0.14em;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.tl-date {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tl-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(14, 12, 20, 0.48);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}

.tl-play, .tl-today {
  flex: 0 0 auto;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
}
.tl-play { width: 40px; }
.tl-play.on { background: rgba(255, 255, 255, 0.28); }
.tl-today { padding: 0 13px; letter-spacing: 0.1em; }
.tl-play:hover, .tl-today:hover { background: rgba(255, 255, 255, 0.22); }

.tl-strip-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 44px;
  cursor: ew-resize;
  touch-action: none;
}

.tl-strip {
  position: absolute;
  inset: 0 0 12px 0;
  width: 100%;
  height: calc(100% - 12px);
  border-radius: 7px;
  display: block;
}

.tl-head {
  position: absolute;
  top: -3px; bottom: 9px;
  width: 0;
  border-left: 2px solid #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.tl-head::after {
  content: '';
  position: absolute;
  left: -5px; top: -5px;
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tl-years {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12px;
  pointer-events: none;
}
.tl-year {
  position: absolute;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

/* ---- chi sei? ---- */

#info {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#info.open { opacity: 1; pointer-events: auto; }

.info-card {
  max-width: 480px;
  margin: 20px;
  padding: 36px 38px;
  border-radius: 18px;
  background: #f6efdf;
  color: #2c3324;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15.5px;
  line-height: 1.65;
  max-height: 80vh;
  overflow-y: auto;
}
.info-card h2 {
  font-size: 19px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 16px;
}
.info-card p { margin-bottom: 13px; }
.info-card .sign {
  margin-top: 18px;
  font-style: italic;
  font-size: 13.5px;
  opacity: 0.75;
}
.info-card .sign .sub { font-size: 12px; }
.info-card .hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(44, 51, 36, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.03em;
  opacity: 0.65;
}
.info-card a { color: #4a6b35; }

@media (max-width: 560px) {
  .tl-today { display: none; }
  .info-card { padding: 26px 24px; font-size: 14.5px; }
  h1 { font-size: 12px; }
}
