/* Game shell — page reset, motion, scrollbar.
   Colors and buttons live in design-system.css. */

/* Boot loading screen (before React mounts) */
#app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  min-height: 100dvh;
  background: var(--c-canvas, #E8E8E8);
  color: var(--c-ink, #111111);
}

.g-app-loading-spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-ink-ghost, rgba(17, 17, 17, .16));
  border-top-color: var(--c-accent, #1B4FE0);
  border-radius: 50%;
  animation: g-app-loading-spin .7s linear infinite;
}

@keyframes g-app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--c-canvas);
  font-family: var(--font-body);
  /* Avoid iOS rubber-band / keyboard focus scrolling the document behind the app */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"],
input,
textarea,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--c-accent);
}

a:hover {
  color: var(--c-ink);
}

* {
  box-sizing: border-box;
}

@keyframes buzz {

  0%,
  100% {
    transform: translate(0, 0) rotate(-.6deg)
  }

  25% {
    transform: translate(-2px, 1px) rotate(.8deg)
  }

  50% {
    transform: translate(2px, -1px) rotate(-.8deg)
  }

  75% {
    transform: translate(-1px, -1px) rotate(.6deg)
  }
}

@keyframes sheetup {
  from {
    transform: translateY(100%)
  }

  to {
    transform: translateY(0)
  }
}

/* Phone open / close */
.g-phone-scrim {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  pointer-events: auto;
}

.g-phone-scrim::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-ink-dim);
  animation: g-phone-scrim-in .34s ease both;
}

.g-phone-scrim.is-closing {
  pointer-events: none;
}

.g-phone-scrim.is-closing::before {
  animation: g-phone-scrim-out .3s ease both;
}

.g-phone-device {
  position: relative;
  z-index: 1;
  width: 94%;
  height: 96%;
  background: var(--c-ink);
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 -18px 50px var(--c-ink-muted);
  animation: g-phone-in .4s cubic-bezier(.2, .9, .25, 1) both;
}

.g-phone-device.is-closing {
  animation: g-phone-out .3s cubic-bezier(.4, 0, .7, .2) both;
}

@keyframes g-phone-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes g-phone-scrim-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes g-phone-in {
  from {
    opacity: 0;
    transform: translateY(22%) scale(.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes g-phone-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(16%) scale(.96);
  }
}

@keyframes blink {

  0%,
  49% {
    opacity: 1
  }

  50%,
  100% {
    opacity: 0
  }
}

@keyframes fadeblack {
  0% {
    opacity: 0
  }

  35% {
    opacity: 1
  }

  70% {
    opacity: 1
  }

  100% {
    opacity: 0
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1
  }

  50% {
    transform: scale(1.12);
    opacity: .82
  }
}

@keyframes fadeup {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.g-end-fadein {
  animation: fadeup var(--dur-fade, .9s) var(--ease, ease) both;
}

.g-end-truth-kicker {
  font-size: var(--fs-caption);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink-dim);
  margin: 0 0 12px;
}

.g-end-truth-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--c-ink);
  margin: 0 0 14px;
}

.g-end-truth-lead {
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--c-muted);
  max-width: 42ch;
  margin: 0 0 22px;
}

.g-end-truth-clip {
  position: relative;
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border: 2px solid var(--c-line);
  background: #111;
  overflow: hidden;
  padding: 0;
}

.g-end-truth-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
  vertical-align: top;
}

.g-end-truth-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.g-end-truth-play-tri {
  display: block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .35));
}

.g-end-sift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 26px;
}

.g-end-sift-cell {
  min-width: 0;
  padding: 16px 14px 18px;
  border: 1px solid var(--c-line);
  background: var(--c-frame);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.g-end-sift-icon {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.g-end-sift-title {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-muted);
  line-height: 1.35;
}

.g-end-sift-value {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.3;
  color: var(--c-accent);
}

@keyframes g-end-polaroid-in {
  from {
    opacity: 0;
    transform: rotate(-14deg) translateY(28px) scale(.94);
  }

  to {
    opacity: 1;
    transform: rotate(-6deg) translateY(0) scale(1);
  }
}

@keyframes g-end-caption-ink {
  0% {
    opacity: 0;
    filter: url(#g-ink-displace) blur(3px) contrast(1.35);
    -webkit-mask-image:
      radial-gradient(ellipse 18% 22% at 30% 60%, #000 0%, transparent 70%),
      radial-gradient(ellipse 14% 18% at 55% 45%, #000 0%, transparent 68%),
      radial-gradient(ellipse 16% 14% at 72% 58%, #000 0%, transparent 72%),
      radial-gradient(ellipse 12% 20% at 48% 70%, #000 0%, transparent 70%);
    mask-image:
      radial-gradient(ellipse 18% 22% at 30% 60%, #000 0%, transparent 70%),
      radial-gradient(ellipse 14% 18% at 55% 45%, #000 0%, transparent 68%),
      radial-gradient(ellipse 16% 14% at 72% 58%, #000 0%, transparent 72%),
      radial-gradient(ellipse 12% 20% at 48% 70%, #000 0%, transparent 70%);
  }

  48% {
    opacity: .9;
    filter: url(#g-ink-displace-soft) blur(.8px) contrast(1.1);
    -webkit-mask-image:
      radial-gradient(ellipse 85% 70% at 40% 55%, #000 25%, transparent 78%),
      radial-gradient(ellipse 70% 80% at 60% 48%, #000 20%, transparent 76%),
      radial-gradient(ellipse 75% 65% at 55% 62%, #000 28%, transparent 80%),
      radial-gradient(ellipse 60% 75% at 45% 50%, #000 18%, transparent 74%);
    mask-image:
      radial-gradient(ellipse 85% 70% at 40% 55%, #000 25%, transparent 78%),
      radial-gradient(ellipse 70% 80% at 60% 48%, #000 20%, transparent 76%),
      radial-gradient(ellipse 75% 65% at 55% 62%, #000 28%, transparent 80%),
      radial-gradient(ellipse 60% 75% at 45% 50%, #000 18%, transparent 74%);
  }

  100% {
    opacity: 1;
    filter: none;
    -webkit-mask-image:
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%);
    mask-image:
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 75%, transparent 100%);
  }
}

@keyframes g-end-photo-ink {
  0% {
    opacity: 0;
    filter: url(#g-ink-displace) contrast(1.25) saturate(.85);
    -webkit-mask-image:
      radial-gradient(ellipse 22% 18% at 42% 48%, #000 0%, transparent 72%),
      radial-gradient(ellipse 18% 22% at 58% 55%, #000 0%, transparent 70%),
      radial-gradient(ellipse 16% 14% at 50% 38%, #000 0%, transparent 68%),
      radial-gradient(ellipse 14% 20% at 48% 62%, #000 0%, transparent 70%);
    mask-image:
      radial-gradient(ellipse 22% 18% at 42% 48%, #000 0%, transparent 72%),
      radial-gradient(ellipse 18% 22% at 58% 55%, #000 0%, transparent 70%),
      radial-gradient(ellipse 16% 14% at 50% 38%, #000 0%, transparent 68%),
      radial-gradient(ellipse 14% 20% at 48% 62%, #000 0%, transparent 70%);
  }

  45% {
    opacity: .92;
    filter: url(#g-ink-displace-soft) contrast(1.08);
    -webkit-mask-image:
      radial-gradient(ellipse 80% 70% at 46% 50%, #000 30%, transparent 78%),
      radial-gradient(ellipse 70% 82% at 56% 52%, #000 24%, transparent 76%),
      radial-gradient(ellipse 75% 65% at 50% 44%, #000 28%, transparent 80%),
      radial-gradient(ellipse 65% 75% at 48% 58%, #000 22%, transparent 74%);
    mask-image:
      radial-gradient(ellipse 80% 70% at 46% 50%, #000 30%, transparent 78%),
      radial-gradient(ellipse 70% 82% at 56% 52%, #000 24%, transparent 76%),
      radial-gradient(ellipse 75% 65% at 50% 44%, #000 28%, transparent 80%),
      radial-gradient(ellipse 65% 75% at 48% 58%, #000 22%, transparent 74%);
  }

  100% {
    opacity: 1;
    filter: none;
    -webkit-mask-image:
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%);
    mask-image:
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%),
      radial-gradient(ellipse 200% 180% at 50% 50%, #000 78%, transparent 100%);
  }
}

.g-end-polaroid-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px var(--space-screen-x) 28px;
  overflow: hidden;
}

.g-end-polaroid {
  margin: 0;
  width: min(72vw, 300px);
  background: #fff;
  padding: 14px 14px 0;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, .04),
    0 18px 40px rgba(0, 0, 0, .18);
  transform: rotate(-6deg);
  animation: g-end-polaroid-in 1.05s var(--ease, cubic-bezier(.22, 1, .36, 1)) both;
}

.g-end-polaroid-photo {
  background: var(--c-wash-alt, #ededed);
  overflow: hidden;
  line-height: 0;
}

.g-end-polaroid-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  animation: g-end-photo-ink 1.5s cubic-bezier(.22, 1, .36, 1) .15s both;
}

.g-end-polaroid-caption {
  margin: 0;
  padding: 22px 10px 28px;
  font-family: var(--font-ending);
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--c-ink);
  text-align: center;
  text-wrap: pretty;
  animation: g-end-caption-ink 1.55s cubic-bezier(.22, 1, .36, 1) .35s both;
}

.g-end-polaroid-caption.is-short {
  padding: 14px 10px 18px;
}

@keyframes grainshift {

  0%,
  100% {
    transform: translate(0, 0)
  }

  20% {
    transform: translate(-2%, 1%)
  }

  40% {
    transform: translate(1%, -2%)
  }

  60% {
    transform: translate(-1%, -1%)
  }

  80% {
    transform: translate(2%, 1%)
  }
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: 0;
}

button:focus-visible {
  outline: 2px solid var(--c-accent, #1B4FE0);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px
}

::-webkit-scrollbar-thumb {
  background: var(--c-muted, #6B6B6B)
}

/* Shared screen shell — scroll body + pinned footer CTA */
.g-screen-flow {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--c-frame);
}

.g-screen-flow-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px var(--space-screen-x) 20px;
}

.g-screen-flow-footer {
  flex: 0 0 auto;
  padding: 14px var(--space-screen-x) calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--c-frame);
  display: flex;
  justify-content: center;
}

/* Name / avatar entry — centered prompt, confirm pinned to bottom */
.g-name-entry {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--c-frame);
}

.g-name-entry-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px var(--space-screen-x) 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.g-name-entry-center {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.g-name-entry-footer {
  flex: 0 0 auto;
  padding: 14px var(--space-screen-x) calc(36px + env(safe-area-inset-bottom, 0px));
  background: var(--c-frame);
  display: flex;
  justify-content: center;
}

/* Notebook — fills viewport above the Close button */
.g-notebook {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 16px var(--space-screen-x) calc(16px + env(safe-area-inset-bottom, 0px));
  gap: 14px;
  background: rgba(17, 17, 17, .42);
}

.g-notebook-book {
  position: relative;
  width: min(440px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  display: flex;
  flex-direction: column;
  background-color: #EFE7D6;
  background-image: url('../assets/notebook_texture.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow: 0 18px 48px rgba(17, 17, 17, .28);
  overflow: hidden;
  transform-origin: center center;
}

.g-notebook-book.is-shelf {
  background: transparent;
  background-image: none;
  box-shadow: none;
  overflow: visible;
}

.g-notebook-shelf {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 4px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.g-notebook-shelf-title {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 22px;
  color: rgba(255, 255, 255, .92);
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0 0 20px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}

.g-notebook-shelf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: min(360px, 100%);
  margin: 0 auto;
}

.g-notebook-shelf-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  cursor: pointer;
  overflow: hidden;
}

.g-notebook-shelf-card:active {
  transform: translateY(1px) scale(0.99);
}

.g-notebook-shelf-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.g-notebook-intro {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 26px 36px;
  box-sizing: border-box;
}

.g-notebook-map {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.g-notebook-map-title {
  flex: 0 0 auto;
  font-family: var(--font-ending);
  font-size: 24px;
  line-height: 1.2;
  color: #2B2418;
  padding: 0 4px;
}

.g-notebook-map-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 4px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(58, 50, 38, .55);
}

.g-rmap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  padding: 0 16px;
  border: 1px solid rgba(74, 66, 56, .16);
  background: rgba(255, 255, 255, .42);
  box-sizing: border-box;
  overflow: hidden;
}

.g-rmap-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 118;
  min-height: 420px;
}

.g-rmap-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.g-rmap-line {
  fill: none;
  stroke-linecap: round;
  transition: opacity .2s ease, stroke-width .2s ease;
}

.g-rmap-line.is-strong {
  stroke: #2B2418;
  stroke-width: 0.55;
}

.g-rmap-line.is-mates {
  stroke: #6B5D42;
  stroke-width: 0.32;
}

.g-rmap-line.is-support {
  stroke: #00B89C;
  stroke-width: 0.38;
}

.g-rmap-line.is-dash {
  stroke: #8A8580;
  stroke-width: 0.28;
  stroke-dasharray: 1.2 1.2;
}

.g-rmap-line.is-pressure {
  stroke: #E01B1B;
  stroke-width: 0.38;
}

.g-rmap-line.is-dim {
  opacity: 0.14;
}

.g-rmap-line.is-lit.is-strong {
  stroke-width: 0.75;
}

.g-rmap-line.is-lit.is-support,
.g-rmap-line.is-lit.is-pressure,
.g-rmap-line.is-lit.is-mates {
  stroke-width: 0.52;
}

.g-rmap-node {
  position: absolute;
  /* Anchor at avatar center (matches SVG edge endpoints), not whole card mid. */
  transform: translate(-50%, -35px);
  width: 96px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.g-rmap-node.is-hero {
  width: 124px;
  transform: translate(-50%, -48px);
  z-index: 3;
}

.g-rmap-node.is-hero .g-rmap-avatar {
  width: 96px;
  height: 96px;
  border-width: 3px;
}

.g-rmap-node.is-hero .g-rmap-name {
  font-size: 13px;
  font-weight: 600;
}

.g-rmap-node.is-small {
  width: 96px;
}

.g-rmap-node.is-small .g-rmap-avatar {
  width: 70px;
  height: 70px;
}

.g-rmap-node.is-offscreen .g-rmap-avatar {
  border-style: dashed;
  border-width: 2.5px;
  background: rgba(255, 255, 255, .35);
}

.g-rmap-node.is-locked {
  opacity: 0.38;
}

.g-rmap-node.is-selected .g-rmap-avatar {
  box-shadow: 0 0 0 3px rgba(27, 79, 224, .22);
}

.g-rmap-avatar {
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2.5px solid var(--rmap-ring, #8A7B5C);
  overflow: hidden;
  background: #EFE7D6;
  box-sizing: border-box;
}

.g-rmap-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-rmap-avatar-empty,
.g-rmap-avatar-q {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 22px;
  color: #8A7B5C;
}

.g-rmap-name {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.2;
  color: #2B2418;
  text-align: center;
}

.g-rmap-sub {
  font-family: var(--font-body);
  font-size: 10px;
  color: #8A7B5C;
  margin-top: -2px;
}

.g-rmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 2px 4px;
}

.g-rmap-legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 11px;
  color: #5C574F;
}

.g-rmap-swatch {
  width: 22px;
  height: 0;
  border-top: 3px solid #2B2418;
  flex: 0 0 auto;
}

.g-rmap-swatch.is-strong {
  border-top-width: 4px;
  border-top-color: #2B2418;
}

.g-rmap-swatch.is-dash {
  border-top-style: dashed;
  border-top-color: #8A8580;
  border-top-width: 2px;
}

.g-rmap-swatch.is-mates {
  border-top-color: #6B5D42;
  border-top-width: 3px;
}

.g-rmap-swatch.is-support {
  border-top-color: #00B89C;
  border-top-width: 3px;
}

.g-rmap-swatch.is-pressure {
  border-top-color: #E01B1B;
  border-top-width: 3px;
}

.g-rmap-panel {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(74, 66, 56, .16);
  background: rgba(255, 255, 255, .35);
  box-sizing: border-box;
}

.g-rmap-panel-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #2B2418;
  margin-bottom: 8px;
}

.g-rmap-panel-fact {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: #3A3226;
  margin: 0 0 6px;
}

.g-rmap-panel-fact:last-child {
  margin-bottom: 0;
}

.g-rmap-panel-empty {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(58, 50, 38, .5);
}

.g-notebook-intro-title {
  font-family: var(--font-ending);
  font-size: 26px;
  line-height: 1.25;
  color: #2B2418;
  margin-bottom: 12px;
  max-width: 16ch;
}

.g-notebook-intro-p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: #3A3226;
  margin: 0 0 18px;
}

.g-notebook-intro-p-lead {
  margin-bottom: 20px;
}

.g-notebook-mil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 28px;
}

.g-notebook-mil-cell {
  min-width: 0;
  padding: 16px 14px 18px;
  border: 1px solid rgba(74, 66, 56, .18);
  background: rgba(255, 255, 255, .28);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.g-notebook-mil-icon {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  opacity: 1;
}

.g-notebook-mil-title {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6B5D42;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  border: 0;
}

.g-notebook-mil-body {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.45;
  color: #3A3226;
  margin: 0;
}

.g-notebook-day {
  flex: 1 1 auto;
  padding: 24px 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.g-notebook-close {
  flex: 0 0 auto;
}

.g-notebook-spine {
  position: relative;
  flex: 0 0 auto;
  height: 8px;
  background: linear-gradient(180deg, rgba(74, 66, 56, .16), rgba(74, 66, 56, .04) 45%, rgba(74, 66, 56, .14));
  pointer-events: none;
}

.g-notebook-page {
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.g-notebook-page-left {
  flex: 0 0 auto;
}

.g-notebook-page-right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.g-notebook-kicker {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8A7B5C;
  margin-bottom: 18px;
  text-align: center;
}

.g-notebook-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  margin: 0 0 8px;
  padding-bottom: 2px;
}

.g-notebook-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 0 8px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.g-notebook-date {
  font-family: var(--font-ending);
  line-height: 1.2;
  color: #2B2418;
}

.g-notebook-date-day {
  font-size: 36px;
}

.g-notebook-date-num {
  font-size: 20px;
}

.g-notebook-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 0 6px;
}

.g-notebook-note-mark {
  flex: 0 0 auto;
  display: block;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: #6B5D42;
}

.g-notebook-note-text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: #3A3226;
}

.g-notebook-todo-title {
  font-family: var(--font-ending);
  font-size: 34px;
  line-height: 1;
  color: #2B2418;
  margin-bottom: 18px;
  flex: 0 0 auto;
}

.g-notebook-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 8px;
}

.g-notebook-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.g-notebook-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(74, 66, 56, .14);
}

.g-notebook-row:last-child {
  border-bottom: 0;
}

.g-notebook-check {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  object-fit: contain;
}

.g-notebook-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: #2B2418;
  padding-top: 1px;
}

.g-notebook-section-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #2B2418;
  margin: 8px 0 8px;
  flex: 0 0 auto;
  line-height: 1.35;
}

.g-notebook-section-title-spaced {
  margin-top: 12px;
}

.g-notebook-got {
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.g-notebook-got-media {
  display: block;
  width: 100%;
  max-width: 168px;
  height: auto;
  border-radius: 4px;
  background: #111111;
}

video.g-notebook-got-media {
  background: #111111;
  max-height: 220px;
  object-fit: cover;
}

.g-notebook-got-img-btn {
  display: block;
  width: fit-content;
  max-width: 168px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.g-notebook-got-img-btn .g-notebook-got-media {
  background: transparent;
  max-height: 168px;
  object-fit: cover;
}

.g-notebook-got-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: #2B2418;
  margin-top: 8px;
}

.g-notebook-got-meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: #8A7B5C;
  margin-top: 2px;
}

.g-notebook-got-audio {
  width: 100%;
  max-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #E4D9BE;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.g-notebook-got-audio-play {
  width: 0;
  height: 0;
  border-left: 11px solid #4A4238;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  flex: 0 0 auto;
}

.g-notebook-got-audio-bars {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.g-notebook-got-audio-bar {
  width: 2px;
  background: #8A7B5C;
}

.g-notebook-got-audio-spec {
  font-family: var(--font-body);
  font-size: 11px;
  color: #8A7B5C;
  flex: 0 0 auto;
}

.g-notebook-verdict {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 4px 0;
  flex: 0 0 auto;
}

.g-notebook-verdict-opt {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border: 0;
  border-radius: 12px;
  padding: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #3A3226;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.g-notebook-verdict-opt:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.g-notebook-verdict-opt.is-on {
  color: #2B2418;
  background: #fff;
  box-shadow: 0 0 0 2px #4A4238;
}

.g-notebook-verdict.is-readonly .g-notebook-verdict-opt {
  cursor: default;
  pointer-events: none;
}

.g-notebook-verdict.is-readonly .g-notebook-verdict-opt:not(.is-on) {
  opacity: 0.4;
}

.g-end-verdict-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.g-end-verdict-row {
  padding: 18px 0;
  border-top: 1px solid var(--c-line);
}

.g-end-verdict-row:first-child {
  border-top: 0;
  padding-top: 4px;
}

.g-end-verdict-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 10px;
}

.g-end-verdict-choices {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
}

.g-end-verdict-opt {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-frame);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 8px 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--c-ink);
  text-align: center;
  cursor: pointer;
}

.g-end-verdict-opt.is-on {
  border-color: var(--c-accent);
  box-shadow: inset 0 0 0 1px var(--c-accent);
  color: var(--c-ink);
}

.g-end-verdict-opt.is-wrong {
  border-color: var(--c-danger);
  box-shadow: inset 0 0 0 1px var(--c-danger);
  color: var(--c-ink);
}

.g-end-verdict-opt.is-answer {
  border-color: var(--c-accent);
  color: var(--c-ink);
  background: var(--c-accent-soft);
}

.g-end-verdict-choices.is-readonly .g-end-verdict-opt {
  cursor: default;
  pointer-events: none;
}

.g-end-verdict-choices.is-readonly .g-end-verdict-opt:not(.is-on):not(.is-answer):not(.is-wrong) {
  opacity: 0.4;
}

.g-end-verdict-answer {
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--c-accent);
  letter-spacing: 0.01em;
}

.g-notebook-note-field {
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(58, 50, 38, 0.25);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: #3A3226;
  padding: 12px 14px;
  outline: none;
  resize: none;
  min-height: 96px;
  display: block;
  flex: 0 0 auto;
}

.g-notebook-note-field:focus {
  border-color: rgba(58, 50, 38, 0.5);
}

.g-notebook.is-opening .g-notebook-book {
  animation: notebook-open .9s cubic-bezier(.16, .8, .24, 1) both;
}

.g-notebook.is-opening .g-notebook-page-left,
.g-notebook.is-opening .g-notebook-page-right {
  animation: notebook-open .9s cubic-bezier(.16, .8, .24, 1) both;
}

@keyframes notebook-open {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Title home glitch — fixed layer outside React (PC only) */
.g-home-glitch-layer {
  display: none;
}

.g-lp {
  position: relative;
  z-index: 1;
  transition: background-color .75s ease;
}

.g-lp.has-home-glitch {
  background: transparent !important;
}

.g-lp.has-home-glitch.is-leaving {
  /* Reveal play canvas under the fading glitch so the handoff doesn't pop. */
  background: var(--c-canvas-play) !important;
}

.g-lp.is-play {
  background: var(--c-canvas-play) !important;
}

.g-lp.is-leaving {
  pointer-events: none;
}

.g-lp.is-leaving .g-lp-frame {
  transition: opacity .55s ease, transform .7s cubic-bezier(.16, .8, .24, 1);
  opacity: 0;
  transform: scale(.985);
}

.g-lp-mark {
  display: none;
}

/* Desktop only: room around the phone mockup */
@media (min-width: 768px) {
  body:has(.g-lp.is-play) {
    background: var(--c-canvas-play);
  }

  /* Viewport chrome — fixed so flex centering / frame z-index can't bury it */
  .g-lp.is-play .g-lp-mark,
  .g-lp:not(.is-title) .g-lp-mark {
    display: block;
    position: fixed;
    left: max(20px, env(safe-area-inset-left, 0px));
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    right: auto;
    top: auto;
    z-index: 20;
    width: min(240px, 26vw);
    height: auto;
    margin: 0;
    pointer-events: none;
    opacity: 1;
    /* SVG is white-filled; keep readable on mid-grey canvas */
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, .45)) drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
  }
}

/* Desktop: fixed phone width; height flexes, but capped on tall screens. */
@media (min-width: 768px) {
  .g-lp-frame {
    --frame-gutter-x: 32px;
    --frame-gutter-y: 22px;
    /* ~iPhone-ish shell; stops the mockup from becoming a tower on tall monitors */
    --frame-max-h: 844px;
    box-sizing: border-box;
    flex: 0 0 auto !important;
    width: 390px !important;
    max-width: calc(100vw - (var(--frame-gutter-x) * 2)) !important;
    height: min(
      calc(100dvh - (var(--frame-gutter-y) * 2)),
      var(--frame-max-h)
    ) !important;
    max-height: min(
      calc(100dvh - (var(--frame-gutter-y) * 2)),
      var(--frame-max-h)
    ) !important;
  }

  /* Title / top page only — thick black device bezel */
  .g-lp-frame:has(.g-title) {
    border: 9px solid #111111;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  }
}

@media (min-width: 768px) {
  .g-home-glitch-layer.is-on {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: auto;
    opacity: 1;
    transition: opacity .75s ease;
  }

  /* Darken class-photo chrome so the title shell pops */
  .g-home-glitch-layer.is-on::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: rgba(8, 8, 10, .48);
    transition: opacity .75s ease;
  }

  body:has(.g-lp.is-leaving) .g-home-glitch-layer.is-on {
    opacity: 0;
    pointer-events: none;
  }

  body:has(.g-lp.is-leaving) {
    background: var(--c-canvas-play);
    transition: background-color .75s ease;
  }

  .g-home-glitch-pane {
    position: relative;
    flex: 0 0 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    pointer-events: auto;
  }

  .g-home-glitch-pane.is-cutting {
    animation: g-home-cut .12s ease-out;
  }

  .g-home-glitch-pane.is-cutting::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: rgba(8, 8, 10, .35);
    opacity: 1;
  }

  .g-home-glitch-half {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
  }

  /* Different crop before glitch captures the texture */
  .g-home-glitch-pane.is-left .g-home-glitch-half {
    object-position: 22% center;
  }

  .g-home-glitch-pane.is-right .g-home-glitch-half {
    object-position: 78% center;
  }

  .g-home-glitch-pane canvas,
  .g-home-glitch-pane [data-glitch-target] {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    pointer-events: auto;
  }
}

@keyframes g-home-cut {
  0% { filter: brightness(1.05) contrast(1.05); }
  100% { filter: none; }
}

/* Title LP — class cast around the phone frame (desktop only) */
.g-lp-cast {
  display: none;
}

@media (min-width: 768px) {
  .g-lp-cast {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    transform: scale(1);
    transition: opacity .55s ease, transform .7s cubic-bezier(.16, .8, .24, 1);
  }

  .g-lp.is-leaving .g-lp-cast {
    opacity: 0;
    transform: scale(1.04);
  }

  .g-lp-cast-face {
    position: absolute;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-line-soft);
    box-shadow: 0 14px 36px rgba(17, 17, 17, .14);
    opacity: .78;
    filter: saturate(.92);
    animation: g-lp-float 7.5s ease-in-out infinite;
  }

  .g-lp-cast-nicole {
    width: 118px;
    height: 118px;
    left: calc(50% - 390px / 2 - 150px);
    top: 18%;
    animation-delay: 0s;
  }

  .g-lp-cast-hanna {
    width: 92px;
    height: 92px;
    left: calc(50% - 390px / 2 - 118px);
    top: 48%;
    animation-delay: -.8s;
  }

  .g-lp-cast-lea {
    width: 78px;
    height: 78px;
    left: calc(50% - 390px / 2 - 96px);
    top: 72%;
    animation-delay: -1.6s;
  }

  .g-lp-cast-mia {
    width: 112px;
    height: 112px;
    left: calc(50% + 390px / 2 + 36px);
    top: 22%;
    animation-delay: -.4s;
  }

  .g-lp-cast-benito {
    width: 88px;
    height: 88px;
    left: calc(50% + 390px / 2 + 58px);
    top: 52%;
    animation-delay: -1.2s;
  }

  .g-lp-cast-nele {
    width: 74px;
    height: 74px;
    left: calc(50% + 390px / 2 + 28px);
    top: 74%;
    animation-delay: -2s;
  }
}

@keyframes g-lp-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Title screen layout */
.g-title {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--c-frame);
}

.g-title-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  padding: 48px var(--space-screen-x) 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  overflow: hidden;
}

.g-title-heading {
  flex: 0 0 auto;
  margin: 28px 0 28px;
  text-align: center;
  line-height: 0;
}

.g-title-logo {
  display: block;
  width: min(272px, 72vw);
  height: auto;
  margin: 0 auto;
}

.g-title-lead {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-ending);
  font-size: 23px;
  line-height: 1.45;
  font-weight: 400;
  color: var(--c-accent-bright);
  max-width: 28ch;
  width: 100%;
  margin: 0 auto 28px;
  text-align: center;
  text-wrap: pretty;
}

.g-title-lead-text {
  white-space: pre-wrap;
}

.g-title-lead-em {
  font-weight: 700;
  color: var(--c-accent-bright);
}

.g-title-caret {
  display: inline-block;
  width: .08em;
  height: 1.05em;
  margin-left: .08em;
  vertical-align: -0.12em;
  background: var(--c-accent-bright);
  animation: g-title-caret-blink .7s step-end infinite;
}

.g-title-actions {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 0 0;
  overflow: visible;
}

.g-title-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.g-title-cta {
  width: 100%;
  max-width: var(--btn-screen-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px 4px;
}

.g-title-cta-secondary {
  width: 100%;
  margin-top: 8px;
}

/* Short shell: tighten chrome so Continue / Start over stay on screen */
@media (max-height: 760px) {
  .g-title-body {
    padding: 20px var(--space-screen-x) 16px;
  }

  .g-title-heading {
    margin: 10px 0 12px;
  }

  .g-title-logo {
    width: min(200px, 58vw);
  }

  .g-title-lead {
    font-size: 17px;
    line-height: 1.35;
    margin-bottom: 12px;
  }

  .g-title-save-stack {
    margin-bottom: 10px;
  }

  .g-title-start {
    min-height: 44px;
  }
}

@media (max-height: 620px) {
  .g-title-body {
    padding: 12px var(--space-screen-x) 10px;
  }

  .g-title-heading {
    margin: 4px 0 8px;
  }

  .g-title-logo {
    width: min(160px, 48vw);
  }

  .g-title-lead {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .g-title-cta-secondary {
    margin-top: 4px;
  }
}

.g-title-save-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.g-title-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.g-title-save-av {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  object-fit: cover;
  background: var(--c-line-soft);
  flex: 0 0 auto;
}

.g-title-save-name {
  font-size: var(--fs-lead);
  font-weight: 700;
  color: var(--c-ink);
  text-align: center;
}

.g-title-save-progress {
  font-size: var(--fs-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent-bright);
  margin-bottom: 0;
  text-align: center;
}

.g-title-start {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 14px 28px;
  border: 0;
  border-radius: 10px;
  background-color: var(--c-accent-pop);
  background-image: url('../assets/button_texture.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: color-burn;
  color: #111111;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  box-shadow: none;
  overflow: visible;
  transition: transform .2s cubic-bezier(.16, .8, .24, 1), filter .2s ease, box-shadow .2s ease;
  animation: g-title-start-in .8s cubic-bezier(.16, .8, .24, 1) .7s both;
}

.g-title-start:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.06) saturate(1.05);
  box-shadow: 4px 6px 0 rgba(17, 17, 17, .14);
}

.g-title-start:active {
  transform: translateY(1px) scale(.99);
  filter: brightness(.97);
  box-shadow: 1px 2px 0 rgba(17, 17, 17, .1);
}

.g-title-start--muted {
  background-color: var(--c-muted-dark);
  color: var(--c-frame);
  font-size: var(--fs-body);
  min-height: 48px;
  padding: 12px 22px;
}

.g-title-album {
  margin-top: 22px;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--c-muted);
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}

.g-title-album--stack {
  margin-top: 2px;
}

.g-title-album:hover {
  transform: translateY(-2px);
  opacity: .9;
}

.g-title-album-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(17, 17, 17, .12));
}

.g-title-album-label {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Day card (fullscreen day intro) */
.g-daycard {
  width: 100%;
  height: 100%;
  padding: 18% var(--space-screen-x) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--c-frame);
  animation: fadeup var(--dur-fade) var(--ease);
}

.g-daycard-kicker {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: var(--fs-title);
  font-weight: var(--font-heading-weight);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-ink);
  line-height: 1;
}

.g-daycard-day {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: var(--font-heading-weight);
  letter-spacing: -.02em;
  line-height: 1.02;
  color: var(--c-ink);
}

.g-daycard-when {
  margin: 0 0 28px;
  font-family: var(--font-heading);
  font-size: var(--fs-title);
  font-weight: var(--font-heading-weight);
  letter-spacing: .02em;
  line-height: 1;
  color: var(--c-ink);
}

.g-daycard-marks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.g-daycard-mark {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--c-accent);
  border-radius: 6px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

.g-daycard-mark.is-past,
.g-daycard-mark.is-current {
  background: var(--c-accent);
}

.g-daycard-mark.is-half {
  background: linear-gradient(
    to top left,
    transparent 0%,
    transparent 49.5%,
    var(--c-accent) 50.5%,
    var(--c-accent) 100%
  );
}

.g-daycard-mark.is-future::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 141%;
  height: 2.5px;
  background: var(--c-accent);
  transform: translate(-50%, -50%) rotate(-45deg);
  transform-origin: center;
}

/* Endings album panel */
.g-endings-gallery {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--c-frame);
  display: flex;
  flex-direction: column;
  animation: g-endings-slide-in .42s cubic-bezier(.16, .8, .24, 1) both;
}

.g-endings-gallery.is-closing {
  animation: g-endings-slide-out .36s cubic-bezier(.4, 0, .7, .2) both;
  pointer-events: none;
}

.g-endings-gallery-head {
  flex: 0 0 auto;
  padding: 28px var(--space-screen-x) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.g-endings-gallery-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px var(--space-screen-x) 32px;
}

.g-endings-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.g-ending-card {
  min-width: 0;
  border: 1px solid var(--c-line);
  background: var(--c-white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.g-ending-card.is-locked {
  opacity: .55;
}

.g-ending-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--c-panel);
  overflow: hidden;
}

.g-ending-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.g-ending-card.is-locked .g-ending-card-img {
  filter: grayscale(1) brightness(.72);
}

.g-ending-card-copy {
  padding: 8px 9px 10px;
}

.g-ending-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 4px;
  line-height: 1.25;
}

.g-ending-card-body {
  font-size: 11px;
  line-height: 1.4;
  color: var(--c-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes g-endings-slide-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes g-endings-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes g-title-caret-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes g-title-lead-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes g-title-start-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hint mark over room lamp (only after today's hint unlocks) */
.g-room-hint-mark {
  position: absolute;
  z-index: 5;
  height: auto;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}

/* Hints dialog (room lamp) */
.g-hints-scrim {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 87;
  background: var(--c-ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px var(--space-screen-x);
  box-sizing: border-box;
}

.g-hints-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 86%);
  box-sizing: border-box;
  background: var(--c-panel);
  padding: 34px 36px;
  animation: fadeup var(--dur-fast) var(--ease);
}

.g-hints-title {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--c-ink);
  margin: 0 0 22px;
  text-align: center;
  line-height: 1.25;
}

.g-hints-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g-hints-card {
  box-sizing: border-box;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  padding: 16px 18px 18px;
}

.g-hints-card-name {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--c-ink);
  line-height: 1.3;
}

.g-hints-card-body {
  margin-top: 10px;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--c-ink);
  text-wrap: pretty;
}

.g-hints-lock-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 108px;
}

.g-hints-lock {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 0.75;
}

.g-hints-locked-msg {
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--c-muted);
  text-align: center;
  text-wrap: balance;
}

.g-hints-close {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 0;
  text-align: center;
}
