/* ===========================================================
   Rainbow Dash · Greentext Archive ("The Sky Index")
   A clean two-pane archive with a Cloudominium / Wonderbolt
   identity, plus the Daring Do flip-book reader.
   Pairs with style.css (sky-blue Neocities aesthetic).
   =========================================================== */

:root {
  --gx-sky-1: #d4f0ff;
  --gx-sky-2: #8cc8f4;
  --gx-deep: #15509e;
  --gx-ink: #123e86;
  --gx-ink-soft: #3a5bb0;
  --gx-line: #8cc6f4;
  --gx-card: #ffffff;
  --gx-card-2: #eef7ff;
  --gx-gold: #ffb01f;
  --gx-rainbow: linear-gradient(90deg, #ff5b6e, #ff9f45, #ffd84d, #5fcf74, #3fd0e6, #4f8df0, #9b6bff);
}

/* view router: each .app-view is a "page"; hidden = not shown */
.app-view[hidden] { display: none; }

.menu-panel a.is-active {
  color: #d62aa0;
  background: rgba(255, 79, 200, .16);
  outline: 1px dashed #ff63c8;
}
.site-footer a.is-active { color: var(--pink); }

.greens {
  position: relative;
  margin-top: 0;
  padding: 14px 14px 20px;
  border: 2px solid #74b6ec;
  border-radius: 10px;
  background:
    radial-gradient(140% 80% at 50% -20%, rgba(255, 255, 255, .8), transparent 55%),
    linear-gradient(180deg, #e9f6ff, #d3ecff);
  box-shadow: 0 4px 14px var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, .7);
}

/* ===========================================================
   BANNER — a sky scene with clouds, rainbow, and a sign
   =========================================================== */
.greens__banner {
  position: relative;
  height: 172px;
  margin-bottom: 12px;
  border: 2px solid #5aa7e8;
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 52%, rgba(214, 238, 255, .55) 78%, rgba(206, 234, 255, .82) 100%),
    url("reading.webp") center 60% / cover no-repeat,
    linear-gradient(180deg, #eaf6ff, #cfe9ff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), inset 0 -16px 26px rgba(40, 110, 190, .18);
}
.greens__banner-art { position: absolute; inset: 0; pointer-events: none; }

.gb-cloud {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    44px 8px 0 -6px #fff, 88px 14px 0 -10px #fff,
    -40px 10px 0 -8px #fff, 22px 22px 0 -4px #fff;
  opacity: .95;
}
.gb-cloud--a { width: 70px; height: 70px; left: 8%; top: 38%; animation: gb-drift 30s ease-in-out infinite alternate; }
.gb-cloud--b { width: 50px; height: 50px; left: 40%; top: 16%; opacity: .8; animation: gb-drift 40s ease-in-out infinite alternate-reverse; }
.gb-cloud--c { width: 60px; height: 60px; left: 64%; top: 52%; opacity: .85; animation: gb-drift 34s ease-in-out infinite alternate; }
@keyframes gb-drift { from { transform: translateX(0); } to { transform: translateX(26px); } }

/* a rainbow arc bursting from bottom-left */
.gb-rainbow {
  position: absolute;
  left: -70px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: conic-gradient(from -45deg, transparent 0 50%, transparent 50%);
  -webkit-mask: radial-gradient(circle, transparent 0 116px, #000 116px 158px, transparent 159px);
          mask: radial-gradient(circle, transparent 0 116px, #000 116px 158px, transparent 159px);
  background-image: radial-gradient(circle,
    transparent 0 116px,
    #ff5b6e 116px 123px, #ff9f45 123px 130px, #ffd84d 130px 137px,
    #5fcf74 137px 144px, #3fd0e6 144px 151px, #9b6bff 151px 158px,
    transparent 159px);
  transform: rotate(8deg);
  opacity: .9;
}
.gb-bolt {
  position: absolute;
  right: 19%;
  top: 16%;
  font-size: 30px;
  color: #fff2a8;
  text-shadow: 0 0 10px rgba(255, 220, 80, .9), 0 2px 0 #e0962a;
  animation: gb-flash 3.6s ease-in-out infinite;
}
@keyframes gb-flash { 0%, 92%, 100% { opacity: .55; } 95% { opacity: 1; } }

/* Wonderbolt insignia roundel */
.gb-badge {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #4f86df, #18408c 72%);
  box-shadow: 0 0 0 4px rgba(255, 216, 77, .85), 0 0 0 7px rgba(24, 64, 140, .8), 0 4px 12px rgba(20, 60, 140, .4);
}
.gb-badge-bolt {
  font-size: 34px;
  color: #ffe27a;
  text-shadow: 0 0 8px rgba(255, 210, 90, .9), 0 2px 0 #c9871c;
  transform: rotate(8deg);
}

/* the sign plaque */
.greens__sign {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 12px 20px;
  text-align: right;
  border: 2px solid #2a62c0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(222, 240, 255, .92));
  box-shadow: 0 6px 16px rgba(20, 70, 150, .3), inset 0 0 0 2px rgba(255, 255, 255, .7);
}
.greens__sign-kicker {
  color: #2a62c0;
  font: 400 9px/1 "Press Start 2P", monospace;
  letter-spacing: .02em;
}
.greens__sign-title {
  font: 800 italic 30px/1 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0;
  background: var(--gx-rainbow);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #1c4ca0;
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 0 rgba(16, 60, 140, .35));
}
.greens__sign-sub {
  color: #3a5bb0;
  font: italic 600 12px/1.2 "IM Fell English", Georgia, serif;
}

/* ===========================================================
   STAT TILES
   =========================================================== */
.greens__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
/* when ratings are hidden, the five-star box is removed — rebalance to 3 */
.greens__stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 12px;
  border: 2px solid #8cc6f4;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #eaf6ff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 2px 6px rgba(20, 70, 150, .12);
}
.stat__icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: #fff;
  border-radius: 50%;
  background: var(--gx-rainbow);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8), 0 2px 5px rgba(20, 70, 150, .25);
  text-shadow: 0 1px 2px rgba(20, 60, 140, .5);
}
.stat__num { align-self: end; color: var(--gx-deep); font: 900 24px/1 "Courier New", monospace; }
.stat__label {
  align-self: start;
  color: #5a7cc0;
  font: 700 11px/1 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ===========================================================
   LAYOUT — filter rail + results
   =========================================================== */
.greens__layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.greens__rail { display: grid; gap: 12px; }

.rail-panel {
  border: 2px solid #8cc6f4;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #e9f5ff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 2px 7px rgba(20, 70, 150, .12);
  overflow: hidden;
}
.rail-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  color: #fff;
  font: 800 14px/1 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 #1c4ca0, 0 2px 3px rgba(0, 0, 0, .15);
  background: linear-gradient(#6fbcff, #3f8fe6);
  border-bottom: 2px solid #2e74cf;
}
.rail-panel__head span { color: #ffe27a; text-shadow: 0 1px 0 #b27e00; }

.rail-field {
  display: grid;
  gap: 3px;
  padding: 8px 12px 0;
}
.rail-field:last-of-type { padding-bottom: 4px; }
.rail-field label {
  color: #5a7cc0;
  font: 700 10px/1 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.greens__search,
.rail-field select {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  color: var(--gx-ink);
  font: 700 13px/1 "Trebuchet MS", Verdana, sans-serif;
  border: 2px solid #8cc6f4;
  border-radius: 8px;
  background: #fff;
}
.greens__search { border-radius: 16px; box-shadow: inset 0 1px 4px rgba(28, 96, 176, .16); }
.greens__search::placeholder { color: #9fbce0; }
.greens__search:focus,
.rail-field select:focus { outline: 2px solid #ff7fd4; outline-offset: 1px; }

.greens__reset {
  width: calc(100% - 24px);
  margin: 10px 12px 12px;
  height: 34px;
  color: #fff;
  font: 900 12px/1 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  border: 2px solid #c77bff;
  border-radius: 8px;
  background: linear-gradient(#ff86d8, #8b63ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.greens__reset:hover,
.greens__reset:focus-visible { filter: brightness(1.07); }

/* top tags cloud */
.tagcloud { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: #2750cf;
  font: 700 11px/1.3 "Courier New", monospace;
  border: 1px solid #aed3f6;
  border-radius: 12px;
  background: #f1f8ff;
  cursor: pointer;
}
.tag:hover,
.tag:focus-visible { color: #fff; background: linear-gradient(#65b6ff, #4f8df0); border-color: #4f8df0; }
.tag__n { color: #8fb4e2; font-size: 9px; }
.tag:hover .tag__n,
.tag:focus-visible .tag__n { color: rgba(255, 255, 255, .85); }
.tag.is-active {
  color: #fff;
  background: linear-gradient(#ff86d8, #8b63ff);
  border-color: #8b63ff;
}
.tag.is-active .tag__n { color: rgba(255, 255, 255, .9); }

/* ===========================================================
   RESULTS — story cards
   =========================================================== */
.greens__results { min-width: 0; }

.results__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border: 2px solid #8cc6f4;
  border-radius: 10px;
  background: linear-gradient(#f3fbff, #ddf0ff);
}
.greens__count {
  margin: 0;
  color: var(--gx-deep);
  font: 900 14px/1 "Courier New", monospace;
}
.results__tools { display: flex; align-items: center; gap: 12px; }

.results__view { display: inline-flex; gap: 4px; }
.results__view button {
  width: 30px;
  height: 28px;
  color: #2848b8;
  font-size: 15px;
  line-height: 1;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: linear-gradient(#fff, #bceaff);
}
.results__view button:hover:not(.is-active) { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.results__view button.is-active {
  color: #fff;
  border-color: #8b63ff;
  background: linear-gradient(#a78bff, #6b48e0);
  cursor: default;
}

.results__pager { display: inline-flex; align-items: center; gap: 8px; }
.results__pager button {
  width: 30px;
  height: 28px;
  color: #2848b8;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: linear-gradient(#fff, #bceaff);
}
.results__pager button:disabled { opacity: .4; cursor: default; }
.results__pager button:hover:not(:disabled) { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.results__pager span { color: var(--gx-ink); font: 900 13px/1 "Courier New", monospace; }

.greens__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ---- "logbook" compact view: one story per row ---- */
.greens__cards--rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.grow {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, 150px) 96px 84px;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 8px;
  border: 1px solid #9bd0f7;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f4faff);
  box-shadow: 0 1px 4px rgba(20, 70, 150, .1);
}
.grow:hover { border-color: #4f8df0; background: #eef7ff; }
.grow__no {
  padding: 3px 0;
  color: #fff;
  font: 900 11px/1 "Courier New", monospace;
  text-align: center;
  border-radius: 8px;
  background: var(--gx-rainbow);
  text-shadow: 0 1px 2px rgba(20, 60, 140, .5);
}
.grow__title { margin: 0; min-width: 0; }
.grow__title button {
  display: block;
  width: 100%;
  padding: 0;
  color: #133e8e;
  font: 800 13.5px/1.3 "Trebuchet MS", Verdana, sans-serif;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border: 0;
  cursor: pointer;
}
.grow__title button:hover,
.grow__title button:focus-visible { color: var(--pink); text-decoration: underline; text-underline-offset: 2px; }
.grow__author {
  min-width: 0;
  color: #6a3fc0;
  font: 700 12px/1.3 "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grow__dist {
  color: #3a78c0;
  font: 400 11px/1.3 "Courier New", monospace;
  text-align: right;
  white-space: nowrap;
}
.grow__cool { white-space: nowrap; text-align: right; }
.grow--nsfw { border-color: #efaec9; background: linear-gradient(180deg, #fff, #ffeff7); }

.gcard {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 12px 12px 10px;
  border: 2px solid #9bd0f7;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gx-card), var(--gx-card-2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8), 0 2px 8px rgba(20, 70, 150, .12);
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease;
}
/* rainbow left edge */
.gcard::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gx-rainbow);
}
.gcard:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(20, 70, 150, .22); }

/* rating accent on the left edge: gold = 5-bolt, rainbow = 4, calm = 3 and under */
.gcard--r5::before { width: 5px; background: linear-gradient(180deg, #ffe65b, #ffb01f); }
.gcard--r5 { border-color: #f3cf72; }
.gcard--r3::before,
.gcard--r2::before,
.gcard--r1::before { background: #b9d8f3; }

/* faint pink wash so NSFW stands out when the filter shows it */
.gcard--nsfw { border-color: #efaec9; background: linear-gradient(180deg, #fff, #ffeff7); }

.gcard__rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font: 900 16px/1 "Courier New", monospace;
  border-radius: 50%;
  background: var(--gx-rainbow);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85), 0 2px 5px rgba(20, 70, 150, .25);
  text-shadow: 0 1px 2px rgba(20, 60, 140, .5);
}

.gcard__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.gcard__title { margin: 0; min-width: 0; flex: 1; }
.gcard__title button {
  display: block;
  width: 100%;
  padding: 0;
  color: #133e8e;
  font: 800 16px/1.22 "Trebuchet MS", Verdana, sans-serif;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.gcard__title button:hover,
.gcard__title button:focus-visible { color: var(--pink); text-decoration: underline; text-underline-offset: 2px; }
.gcard__stars {
  flex: 0 0 auto;
  color: var(--gx-gold);
  font-size: 14px;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(150, 100, 10, .35);
}

.gcard__meta {
  margin: 3px 0 6px;
  color: #5a6ea8;
  font: 400 12px/1.35 "Courier New", monospace;
}
.gcard__meta b { color: #6a3fc0; font-weight: 700; }
.gcard__series { color: #2f7bb8; }

.gcard__summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 7px;
  color: #2a4485;
  font: 400 13px/1.45 "Trebuchet MS", Verdana, sans-serif;
}
.gcard--featured .gcard__summary { -webkit-line-clamp: 4; }

/* "Dash's take" — slim italic quote with a rainbow bar; only the
   featured card gets the full boxed treatment */
.gcard__note {
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 8px;
  padding: 0 0 0 11px;
  color: #4a4068;
  font: italic 400 12.5px/1.42 "IM Fell English", Georgia, serif;
}
.gcard__note::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--gx-rainbow);
}
.gcard--featured .gcard__note {
  -webkit-line-clamp: 3;
  padding: 5px 9px 5px 12px;
  background: rgba(120, 160, 230, .1);
  border-radius: 0 7px 7px 0;
}

.gcard__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  font: 900 10px/1.6 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 10px;
}
.badge--sfw { color: #fff; background: #46b06b; }
.badge--nsfw { color: #fff; background: #e0556a; }
.badge--form { color: #15388e; background: #cdeaff; border: 1px solid #8bd0ff; }

.chip {
  padding: 1px 8px;
  color: #2750cf;
  font: 700 11px/1.6 "Courier New", monospace;
  border: 1px solid #aed3f6;
  border-radius: 10px;
  background: #f1f8ff;
  cursor: pointer;
}
.chip:hover,
.chip:focus-visible { color: #fff; background: linear-gradient(#65b6ff, #4f8df0); border-color: #4f8df0; }

.gcard__src { display: inline-flex; gap: 6px; margin-left: auto; }
.src {
  padding: 1px 8px;
  color: #fff;
  font: 700 10px/1.7 "Courier New", monospace;
  text-decoration: none;
  border-radius: 10px;
  background: #4f8df0;
}
.src:hover { background: #2f6fd6; color: #fff; }

.greens__empty {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
  color: #3a5bb0;
  font: 700 14px/1.5 "Courier New", monospace;
}

/* ===========================================================
   FLIGHT-LOG personality layer (Rainbow Dash, not Applejack)
   =========================================================== */

/* cards streak in like a fly-by; light contrail whoosh on hover */
.greens__cards { perspective: 900px; }
.greens__cards.is-streaking .gcard {
  animation: gx-streak .5s cubic-bezier(.18, .72, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes gx-streak {
  from { opacity: 0; transform: translateX(46px) skewX(-5deg); }
  to { opacity: 1; transform: none; }
}
.gcard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .6) 46%, transparent 60%);
  opacity: 0;
  transform: translateX(-130%);
}
.gcard:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(20, 70, 150, .24); }
.gcard:hover::after { animation: gx-whoosh .6s ease; }
@keyframes gx-whoosh {
  0% { opacity: 0; transform: translateX(-130%); }
  30% { opacity: .85; }
  100% { opacity: 0; transform: translateX(130%); }
}

/* grid column for the Wonderbolt badge */
.gcard { grid-template-columns: 44px minmax(0, 1fr); }

/* Wonderbolt flight-number badge (replaces the plain medallion) */
.gcard__badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 48px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(160deg, #3568c8, #143b88);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 77, .55), 0 2px 6px rgba(20, 60, 140, .4);
}
.gcard__badge::before {
  content: "⚡";
  position: absolute;
  font-size: 40px;
  line-height: 1;
  color: rgba(255, 216, 77, .2);
  transform: rotate(-10deg);
}
.gcard__badge-flt {
  position: relative;
  color: #bcd6ff;
  font: 700 7px/1 "Courier New", monospace;
  letter-spacing: .16em;
}
.gcard__badge-no {
  position: relative;
  color: #fff;
  font: 900 14px/1 "Courier New", monospace;
  text-shadow: 0 1px 2px rgba(0, 20, 60, .6);
}

/* Cool-Meter rating (her catchphrase, not gold stars) */
.cool { display: inline-flex; gap: 1px; flex: 0 0 auto; line-height: 1; }
.cool__b {
  font-size: 13px;
  color: #ffc21f;
  text-shadow: 0 0 5px rgba(255, 185, 30, .7), 0 1px 0 #b56f00;
}
.cool__b--off { color: #c2d4ea; text-shadow: none; opacity: .75; }

/* meta tweaks */
.gcard__meta b { color: #6a3fc0; }
.gcard__series { color: #2f7bb8; }
.gcard__dist { color: #3a78c0; white-space: nowrap; }

/* "Dash's verdict" tag before the review note */
.gcard__verdict {
  color: #2f6fd6;
  font: 800 10.5px/1 "Trebuchet MS", Verdana, sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* contrail divider above the foot */
.gcard__foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #bcd6f2;
}

/* ---- the grid-breaking "Now Flying" lead card ---- */
.gcard--featured {
  grid-column: 1 / -1;
  grid-template-columns: 52px minmax(0, 1fr);
  padding: 14px 16px;
  border-color: #7fb3ef;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 91, 110, .08), transparent 38%),
    radial-gradient(120% 140% at 100% 0%, rgba(155, 107, 255, .1), transparent 42%),
    linear-gradient(180deg, #ffffff, #eaf4ff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85), 0 6px 18px rgba(20, 70, 150, .2);
}
.gcard--featured .gcard__badge { width: 52px; height: 58px; }
.gcard--featured .gcard__badge-no { font-size: 17px; }
.gcard--featured .gcard__title button { font-size: 22px; line-height: 1.15; }
.gcard--featured .gcard__summary { font-size: 14px; color: #243f7c; }
.gcard--featured .cool__b { font-size: 16px; }

.gcard__nowflying {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  padding: 2px 10px;
  color: #fff;
  font: 900 10px/1.6 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-radius: 11px;
  background: var(--gx-rainbow);
  box-shadow: 0 1px 4px rgba(20, 70, 150, .3);
  text-shadow: 0 1px 1px rgba(20, 60, 140, .5);
}

/* rubber-stamp % cooler badge in the corner */
.gcard__stamp {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  transform: rotate(-9deg);
  color: #ff4d79;
  font: 900 22px/.8 "Courier New", monospace;
  text-align: center;
  border: 3px solid #ff4d79;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 77, 121, .25);
  opacity: .92;
}
.gcard__stamp i { font: 800 9px/1 "Courier New", monospace; font-style: normal; letter-spacing: .12em; text-transform: uppercase; }

.gcard__go {
  margin-left: auto;
  padding: 3px 14px;
  color: #fff;
  font: 900 11px/1.7 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(#ff86d8, #8b63ff);
  box-shadow: 0 2px 5px rgba(80, 40, 160, .3);
  cursor: pointer;
}
.gcard__go:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .gcard--featured { grid-template-columns: 44px minmax(0, 1fr); }
  .gcard__stamp { width: 52px; height: 52px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .greens__cards.is-streaking .gcard { animation: none; }
  .gcard:hover::after { animation: none; }
}

/* bottom pager */
.greens__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.greens__pager button {
  height: 30px;
  padding: 0 14px;
  color: #2848b8;
  font: 900 12px/1 "Courier New", monospace;
  text-transform: uppercase;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: linear-gradient(#fff, #bceaff);
}
.greens__pager button:hover:not(:disabled),
.greens__pager button:focus-visible:not(:disabled) { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.greens__pager button:disabled { opacity: .4; cursor: default; }
.greens__pager span { color: var(--gx-deep); font: 900 13px/1 "Courier New", monospace; }

/* ===========================================================
   READER — Daring Do book on the cloud desk
   =========================================================== */
.greens__reader { position: relative; }

.greens__reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border: 2px solid #8cc6f4;
  border-radius: 10px;
  background: linear-gradient(#f3fbff, #ddf0ff);
}
.greens__reader-bar button {
  height: 30px;
  padding: 0 14px;
  color: #2848b8;
  font: 900 12px/1 "Courier New", monospace;
  text-transform: uppercase;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: linear-gradient(#fff, #bceaff);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9);
}
.greens__reader-bar button:hover,
.greens__reader-bar button:focus-visible { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.greens__reader-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.greens__reader-id { flex: 1 1 240px; min-width: 0; }
.greens__reader-id h3 {
  margin: 0;
  color: #133e8e;
  font: 800 16px/1.25 "Trebuchet MS", Verdana, sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.greens__reader-id p {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  color: #5a6ea8;
  font: 700 12px/1.2 "Courier New", monospace;
}
.greens__reader-id .gcard__stars { font-size: 13px; }

/* reading-options popover */
.greens__options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 2px solid #8cc6f4;
  border-radius: 10px;
  background: linear-gradient(#f3fbff, #dcefff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.greens__options[hidden] { display: none; }
.greens__opt { display: inline-flex; align-items: center; gap: 7px; }
.greens__opt-label {
  color: #5a7cc0;
  font: 900 11px/1 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.greens__opt select {
  height: 30px;
  padding: 0 8px;
  color: var(--gx-ink);
  font: 700 13px/1 "Trebuchet MS", Verdana, sans-serif;
  border: 2px solid #8cc6f4;
  border-radius: 6px;
  background: #fff;
}
.greens__opt-stepper { display: inline-flex; align-items: center; gap: 6px; }
.greens__opt-stepper button {
  width: 28px;
  height: 28px;
  color: #2848b8;
  font: 900 16px/1 "Courier New", monospace;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: linear-gradient(#fff, #bceaff);
}
.greens__opt-stepper button:disabled { opacity: .4; cursor: default; }
.greens__opt-stepper span { min-width: 24px; text-align: center; color: var(--gx-deep); font: 900 13px/1 "Courier New", monospace; }
.greens__opt-papers { display: inline-flex; gap: 6px; }
.paper-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #7eb8ea;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4);
}
.paper-swatch--parchment { background: linear-gradient(160deg, #fbf3da, #efe2bf); }
.paper-swatch--sepia { background: linear-gradient(160deg, #f3e0b8, #e3c891); }
.paper-swatch--green { background: linear-gradient(160deg, #e8f6dd, #bdd9a8); }
.paper-swatch--night { background: linear-gradient(160deg, #2c2722, #211d18); }
.paper-swatch.is-active { border-color: #ff4fc8; box-shadow: 0 0 0 2px rgba(255, 79, 200, .5), inset 0 0 0 2px rgba(255, 255, 255, .4); }
.greens__opt-reset {
  height: 30px;
  padding: 0 14px;
  margin-left: auto;
  color: #2848b8;
  font: 900 11px/1 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 2px solid #7eb8ea;
  border-radius: 6px;
  background: #fff;
}

/* the cloud desk the book rests on */
.greens__desk {
  position: relative;
  display: grid;
  place-items: center;
  padding: 30px 12px 26px;
  border: 2px solid #74b6ec;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 58% 46% at 50% 54%, rgba(255, 255, 255, .22), transparent 72%),
    url("back.webp") center / cover no-repeat,
    linear-gradient(180deg, #bfe9ff, #74b6ee);
  box-shadow: inset 0 0 70px rgba(30, 70, 130, .3), inset 0 0 0 2px rgba(255, 255, 255, .45);
  overflow: hidden;
}

.greens__stage { position: relative; z-index: 1; transform-origin: top center; }
.greens__stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 86%;
  height: 40px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(13, 48, 121, .4), transparent 72%);
  filter: blur(3px);
  z-index: -1;
}
#greens-book { margin: 0 auto; }

/* ---- focus / full-screen reading ---- */
#greens-focus[aria-pressed="true"] { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }

.greens__reader.is-focus {
  position: fixed;
  inset: 0;
  z-index: 60;
  margin: 0;
  padding: 12px clamp(10px, 4vw, 48px) 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background:
    radial-gradient(120% 70% at 50% -8%, #d9f2ff, transparent 60%),
    linear-gradient(180deg, #aee0ff, #6fb1ec 55%, #2f74cf);
}
.greens__reader.is-focus .greens__reader-bar,
.greens__reader.is-focus .greens__options { margin-bottom: 0; }
.greens__reader.is-focus .greens__desk { flex: 1 1 auto; min-height: 0; }
.greens__reader.is-focus .greens__book-controls { margin-top: 4px; }
.greens__reader.is-focus .greens__reader-note { margin-top: 0; }

/* leaves */
.bookpage {
  box-sizing: border-box;
  background:
    linear-gradient(90deg, rgba(120, 88, 40, .14), transparent 6%, transparent 94%, rgba(120, 88, 40, .14)),
    radial-gradient(circle at 18% 12%, rgba(255, 247, 222, .9), transparent 40%),
    linear-gradient(160deg, #fbf3da, #efe2bf);
  color: #3a2c12;
  box-shadow: inset 0 0 28px rgba(120, 88, 40, .18);
  overflow: hidden;
}
.bookpage__inner { display: flex; flex-direction: column; height: 100%; padding: 26px 30px 16px; }
.bookpage__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  font-family: var(--book-font-family, "IM Fell English", Georgia, serif);
  font-size: var(--book-font-size, 17px);
  line-height: var(--book-line-height, 1.5);
  white-space: normal;
  word-wrap: break-word;
}
.bookpage__body p { margin: 0 0 .7em; text-align: justify; hyphens: auto; }
.bookpage__body p:last-child { margin-bottom: 0; }
.bookpage__body .gt { display: block; margin: 0 0 .25em; color: #2f7d1f; text-align: left; }
.bookpage__folio {
  flex: 0 0 auto;
  margin-top: 8px;
  color: #8a6a36;
  font: 700 10px/1 "Special Elite", "Courier New", monospace;
  text-align: center;
  letter-spacing: .08em;
}

/* paper themes (applied via [data-paper] on the reader) */
.greens__reader[data-paper="sepia"] .bookpage:not(.bookpage--cover):not(.bookpage--back) {
  color: #43321b;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 240, 210, .85), transparent 42%),
    linear-gradient(160deg, #f3e0b8, #e3c891);
}
.greens__reader[data-paper="sepia"] .bookpage__body .gt { color: #2f6d1d; }
.greens__reader[data-paper="green"] .bookpage:not(.bookpage--cover):not(.bookpage--back) {
  color: #183421;
  background:
    radial-gradient(circle at 18% 12%, rgba(250, 255, 238, .9), transparent 42%),
    linear-gradient(160deg, #eef8e5, #cfe5bd);
}
.greens__reader[data-paper="green"] .bookpage__body .gt { color: #167526; }
.greens__reader[data-paper="green"] .bookpage__folio { color: #587247; }
.greens__reader[data-paper="green"] .title-stamp,
.greens__reader[data-paper="green"] .title-author,
.greens__reader[data-paper="green"] .title-blurb { color: #31502d; }
.greens__reader[data-paper="green"] .bookpage--title h2 { color: #183421; }
.greens__reader[data-paper="night"] .bookpage:not(.bookpage--cover):not(.bookpage--back) {
  color: #d9cdb1;
  background:
    radial-gradient(circle at 18% 12%, rgba(96, 86, 66, .35), transparent 45%),
    linear-gradient(160deg, #2c2722, #211d18);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, .5);
}
.greens__reader[data-paper="night"] .bookpage__body .gt { color: #8fd27a; }
.greens__reader[data-paper="night"] .bookpage__folio { color: #8c7d5c; }
.greens__reader[data-paper="night"] .title-stamp,
.greens__reader[data-paper="night"] .title-author,
.greens__reader[data-paper="night"] .title-blurb { color: #e3d6ba; }
.greens__reader[data-paper="night"] .bookpage--title h2 { color: #f3e7c9; }

/* hard covers */
.bookpage--cover,
.bookpage--back { color: #fff; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .12), inset 0 0 40px rgba(0, 0, 0, .35); }
.bookpage--cover {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 14%),
    var(--book-cover, url("cover.webp")) center / cover no-repeat,
    #2a1c33;
}
.bookpage--cover-0 { --book-cover: url("cover.webp"); }
.bookpage--cover-1 { --book-cover: url("cover2.webp"); }
.bookpage--cover-2 { --book-cover: url("cover3.webp"); }
.bookpage--cover-3 { --book-cover: url("cover4.webp"); }
.bookpage--cover-4 { --book-cover: url("cover5.webp"); }
.bookpage--back {
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, transparent 86%, rgba(0, 0, 0, .35)),
    radial-gradient(circle at 50% 38%, #5b3f6e, #2a1c33 70%);
}
.bookpage--back .back-emblem {
  width: 64%;
  text-align: center;
  color: #ffd93c;
  font: 900 13px/1.6 "Press Start 2P", monospace;
  text-shadow: 0 2px 0 #7a4e12, 0 0 12px rgba(255, 200, 60, .5);
}

/* title leaf */
.bookpage--title .bookpage__inner { justify-content: center; text-align: center; }
.bookpage--title .title-stamp {
  margin: 0 auto 14px;
  padding: 4px 10px;
  display: inline-block;
  color: #6b4a16;
  font: 700 10px/1 "Special Elite", monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid #b89556;
  border-radius: 3px;
}
.bookpage--title h2 { margin: 0 0 12px; color: #34240f; font: 700 24px/1.18 "Special Elite", Georgia, serif; }
.bookpage--title .title-author { margin: 0 0 18px; color: #6a4f24; font: 400 15px/1.4 "Special Elite", Georgia, serif; }
.bookpage--title .title-blurb { margin: 0 auto; max-width: 80%; color: #4a3818; font: italic 400 13px/1.5 "Special Elite", Georgia, serif; }
.bookpage--title .title-rule { width: 54%; height: 2px; margin: 16px auto; background: linear-gradient(90deg, transparent, #b89556, transparent); }

/* book controls */
.greens__book-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.greens__book-controls button {
  width: 44px;
  height: 36px;
  color: #2848b8;
  font-size: 16px;
  border: 2px solid #7eb8ea;
  border-radius: 8px;
  background: linear-gradient(#fff, #bceaff);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9);
}
.greens__book-controls button:hover:not(:disabled),
.greens__book-controls button:focus-visible:not(:disabled) { color: #fff; background: linear-gradient(#ff86d8, #8b63ff); }
.greens__book-controls button:disabled { opacity: .4; cursor: default; }
.greens__book-controls input[type="range"] { flex: 1 1 200px; max-width: 320px; accent-color: #6b62ff; }
.greens__page-readout { min-width: 92px; color: var(--gx-deep); font: 900 13px/1 "Courier New", monospace; text-align: center; }

.greens__reader-note { margin: 12px 0 0; text-align: center; color: #3a5bb0; font: 700 12px/1.45 "Courier New", monospace; }
.greens__reader-note a { color: #2448c9; }

/* loading veil */
.greens__loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--gx-deep);
  font: 900 14px/1.4 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(214, 240, 255, .82);
  border-radius: 12px;
}
.greens__loading[hidden] { display: none; }
.greens__loading::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 4px solid rgba(43, 116, 200, .3);
  border-top-color: #ff4fc8;
  border-radius: 50%;
  animation: greens-spin .8s linear infinite;
}
@keyframes greens-spin { to { transform: rotate(360deg); } }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1080px) {
  .greens__layout { grid-template-columns: 1fr; }
  .greens__rail { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .greens {
    padding: 8px;
    border-radius: 8px;
  }

  .greens__banner {
    height: 132px;
    margin-bottom: 10px;
    background-position: center;
  }

  .greens__sign {
    left: 10px;
    right: 10px;
    align-items: center;
    padding: 10px 12px;
    text-align: center;
  }

  .greens__sign-kicker {
    font-size: 8px;
  }

  .greens__sign-title {
    font-size: 21px;
    -webkit-text-stroke-width: 1.5px;
  }

  .greens__sign-sub {
    font-size: 12px;
  }

  .greens__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 8px;
  }

  .stat__icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .stat__num {
    font-size: 20px;
  }

  .stat__label {
    font-size: 9px;
  }

  .greens__rail {
    grid-template-columns: 1fr;
  }

  .rail-panel__head {
    padding: 10px 12px;
  }

  .greens__search,
  .rail-field select {
    height: 40px;
    font-size: 15px;
  }

  .tagcloud {
    max-height: 132px;
    overflow: auto;
  }

  .results__bar {
    align-items: stretch;
    flex-direction: column;
  }

  .results__tools,
  .results__pager {
    justify-content: space-between;
    gap: 8px;
  }

  .results__view button,
  .results__pager button {
    width: 40px;
    height: 36px;
  }

  .greens__cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .grow {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 46px;
  }

  .grow__author,
  .grow__dist { display: none; }

  .gcard {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 10px 10px 8px;
    border-radius: 8px;
  }

  .gcard:hover {
    transform: none;
  }

  .gcard__badge {
    width: 38px;
    height: 42px;
  }

  .gcard__top {
    display: block;
  }

  .gcard__title button,
  .gcard--featured .gcard__title button {
    font-size: 16px;
    line-height: 1.25;
  }

  .gcard__src {
    margin-left: 0;
  }

  .gcard__go {
    width: 100%;
    min-height: 36px;
    margin-left: 0;
  }

  .greens__pager {
    gap: 8px;
  }

  .greens__pager button {
    min-width: 88px;
    height: 38px;
  }

  .greens__reader-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .greens__reader-bar button {
    min-height: 40px;
    height: auto;
    padding: 0 10px;
    white-space: normal;
  }

  .greens__reader-id h3 {
    white-space: normal;
  }

  .greens__reader-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .greens__reader-tools button:last-child {
    grid-column: 1 / -1;
  }

  .greens__options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .greens__opt {
    justify-content: space-between;
    min-height: 36px;
  }

  .greens__opt select {
    min-width: 150px;
    height: 36px;
  }

  .greens__opt-stepper button,
  .paper-swatch {
    width: 36px;
    height: 36px;
  }

  .greens__opt-reset {
    width: 100%;
    min-height: 38px;
    margin-left: 0;
  }

  .greens__desk {
    padding: 14px 8px;
    border-radius: 8px;
  }

  .bookpage__inner {
    padding: 18px 18px 12px;
  }

  .bookpage__body p {
    text-align: left;
    hyphens: manual;
  }

  .bookpage--title .title-stamp {
    margin-bottom: 10px;
    font-size: 8px;
  }

  .bookpage--title h2 {
    font-size: 20px;
  }

  .bookpage--title .title-author {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .bookpage--title .title-blurb {
    max-width: 100%;
    font-size: 12px;
  }

  .greens__book-controls {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }

  .greens__book-controls button {
    width: 52px;
    height: 40px;
  }

  .greens__book-controls input[type="range"] {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
  }

  .greens__page-readout {
    min-width: 0;
    flex: 1 1 auto;
  }

  .greens__reader-note {
    font-size: 11px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gb-cloud, .gb-bolt, .greens__desk::before, .greens__desk::after, .greens__loading::before { animation: none; }
}
