/* Poetic Prompts — the Leaderboard and My Poems pages.
   A single parchment "ledger" on the chiaroscuro backdrop, same masthead and
   drawer as the game page (style.css). Rubric red for ranks and scores,
   lapis for the level numerals, gold/silver/bronze wax for the top three. */

.ledger-page {
  min-height: 100svh;
  padding: 118px 16px 56px;
  display: flex;
  justify-content: center;
}
.ledger {
  position: relative;
  width: min(760px, 100%);
  align-self: flex-start;
  padding: 44px clamp(20px, 5vw, 56px) 34px;
  color: var(--ink);
  /* no fill colour: the torn edges must stay torn. The top and bottom 60px of the 900x1300 paper are
     its torn edges: drawn at their natural size, with only the middle stretched, so a long page
     doesn't pull the tears down over its title. */
  border: 0 solid transparent;
  border-image: url("assets/paper-tall.webp") 60 0 fill / clamp(20px, calc(6.67vw - 2px), 51px) 0 stretch;
  filter: var(--paper-dim) drop-shadow(0 18px 30px rgba(15, 8, 3, 0.55));
  border-radius: 3px;
}
.ledger-kicker { margin: 0; font: 600 14px/1.3 "Cormorant SC", serif; letter-spacing: 0.1em; color: var(--ink-soft); text-align: center; }
.ledger-title { margin: 6px 0 0; text-align: center; font: 600 clamp(30px, 6vw, 42px)/1.1 "Cinzel", serif; letter-spacing: 0.06em; }
.ledger-empty { margin: 26px 0 8px; text-align: center; font: italic 500 20px/1.45 "Cormorant Garamond", serif; color: var(--ink-soft); }
.ledger-empty a { color: var(--rubric); font-weight: 600; }
.ledger-foot { margin-top: 30px; padding-top: 16px; border-top: 1.5px solid rgba(42, 33, 25, 0.16); text-align: center;
  font: 500 16.5px/1.5 "Cormorant Garamond", serif; color: var(--ink-soft); }
.ledger-foot p { margin: 4px 0; }
.ledger-foot b { color: var(--ink); font-weight: 600; }

/* ---------- day switcher ---------- */
.day-switch { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 22px; }
.day-switch span { min-width: 7.5em; text-align: center; font: italic 600 21px "Cormorant Garamond", serif; }
.day-switch button {
  width: 44px; height: 44px; border: 1.5px solid rgba(42, 33, 25, 0.35); border-radius: 50%;
  background: transparent; color: var(--ink); font: 400 28px/1 "Cormorant Garamond", serif; cursor: pointer;
}
.day-switch button:hover:not(:disabled) { background: rgba(42, 33, 25, 0.07); }
.day-switch button:disabled { opacity: 0.3; cursor: default; }

/* ---------- the rankings ---------- */
.board { list-style: none; margin: 0; padding: 0; }
.board .row {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr) auto 5.2em;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(42, 33, 25, 0.12);
}
.board .rank { font: 600 20px/1 "Cinzel", serif; color: var(--ink-soft); text-align: center; font-variant-numeric: lining-nums tabular-nums; }
.board .who { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.board .name { font: 400 30px/1.1 "Pinyon Script", cursive; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .you { font: 600 12px/1 "Cinzel", serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric); }
.board .lvl { font: italic 500 17px/1 "Cormorant Garamond", serif; color: var(--ink-soft); white-space: nowrap; }
.board .lvl i, .entry .lvl i { font: normal 600 14px "Cinzel", serif; color: #2f4f86; margin-right: 2px; }
.board .pts { text-align: right; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.board .pts b { font: 700 28px/1 "Cormorant Garamond", serif; color: var(--rubric); }
.board .pts small { font: 500 15px "Cormorant Garamond", serif; color: var(--ink-soft); }
.board .row.me { background: rgba(166, 50, 31, 0.07); border-radius: 3px; }
/* gold, silver and bronze wax for the top three */
.board .top .rank {
  width: 38px; height: 38px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  color: #fff8ea; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.25), 0 2px 3px rgba(40, 20, 10, 0.3);
}
.board .top-1 .rank { background: radial-gradient(circle at 35% 30%, #f1cf6e, #b08a2e 70%); }
.board .top-2 .rank { background: radial-gradient(circle at 35% 30%, #e4e4e8, #8d8f99 70%); }
.board .top-3 .rank { background: radial-gradient(circle at 35% 30%, #e0a06a, #965a2a 70%); }

/* ---------- my poems ---------- */
.folio-sum { margin: 8px 0 0; text-align: center; font: italic 500 19px "Cormorant Garamond", serif; color: var(--ink-soft); }
.folio { margin-top: 18px; }
.entry { padding: 22px 0 20px; border-top: 1.5px solid rgba(42, 33, 25, 0.16); }
.entry header { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: end; }
.entry .when { grid-column: 1 / -1; margin: 0; font: 600 13.5px "Cormorant SC", serif; letter-spacing: 0.08em; color: var(--ink-soft); }
.entry h2 { margin: 0; font: italic 600 26px/1.15 "Cormorant Garamond", serif; }
.entry h2 .dev { display: block; font: normal 600 15px "Cormorant SC", serif; letter-spacing: 0.06em; color: var(--ink-soft); }
.entry .score { margin: 0; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.entry .score b { font: 700 40px/1 "Cormorant Garamond", serif; color: var(--rubric); }
.entry .score small { font: 500 16px "Cormorant Garamond", serif; color: var(--ink-soft); }
.entry .score .lvl { display: block; font: italic 500 16px "Cormorant Garamond", serif; color: var(--ink-soft); white-space: nowrap; }
.entry .poem { margin: 14px 0 0; white-space: pre-wrap; font: 19px/1.7 "IM Fell English", Georgia, serif; color: var(--ink); }
.entry .sig { margin: 6px 0 0; text-align: right; font: 28px/1 "Pinyon Script", cursive; }
.entry footer { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 18px; }
.entry .status { font: 600 12.5px "Cinzel", serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.entry .status.on { color: #2f4f86; }
.notes { flex: 1 1 100%; }
.notes summary { cursor: pointer; width: max-content; min-height: 32px; font: italic 600 18px "Cormorant Garamond", serif; color: var(--rubric); }
.notes ul { margin: 8px 0 0; padding-left: 18px; font: 500 16.5px/1.45 "Cormorant Garamond", serif; }
.notes li { margin: 3px 0; }
.notes li b { font: 600 12.5px "Cinzel", serif; letter-spacing: 0.1em; text-transform: uppercase; }
.notes .n { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.notes .tip { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--rubric); background: rgba(166, 50, 31, 0.06);
  font: 500 17px/1.4 "Cormorant Garamond", serif; }

.topnav a[aria-current="page"] { background-size: 100% 1.5px; }

@media (max-width: 720px) {
  .ledger-page { padding: 96px 12px 40px; }
  .ledger { padding: 34px 18px 26px; }
  .board .row { grid-template-columns: 2.2em minmax(0, 1fr) 4.4em; gap: 10px; padding: 10px 4px; }
  .board .lvl { display: none; }
  .board .name { font-size: 26px; }
  .entry h2 { font-size: 22px; }
  .entry .score b { font-size: 34px; }
}

/* ---------- privacy & rules (prose) ---------- */
.prose { font: 500 18px/1.55 "Cormorant Garamond", serif; }
.prose h2 { margin: 26px 0 6px; font: 600 15px/1.3 "Cinzel", serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rubric); }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose p { margin: 8px 0; }
.prose b { font-weight: 700; }
.danger-zone { margin: 14px 0; }
.danger {
  min-height: 44px; padding: 0 18px; border: 1.5px solid #8f2416; border-radius: 2px;
  background: transparent; color: #8f2416; font: italic 600 18px "Cormorant Garamond", serif; cursor: pointer;
}
.danger:hover, .danger.armed { background: #8f2416; color: #fff6e6; }
.danger:disabled { opacity: 0.6; cursor: default; }
.danger-note { font-style: italic; color: var(--ink-soft); }

/* ---------------------------------------------------------------- owner's desk */
.owner .o-help { color: var(--ink-soft); font-style: italic; }
.o-btn { font: 600 15px/1 "Cormorant Garamond", serif; padding: 7px 12px; border: 1px solid rgba(42, 33, 25, 0.35); border-radius: 3px;
  background: transparent; color: var(--ink); cursor: pointer; }
.o-btn:hover:not(:disabled) { background: rgba(42, 33, 25, 0.07); }
.o-btn.primary { background: var(--rubric); border-color: var(--rubric); color: #fff6e6; }
.o-btn:disabled { opacity: 0.5; cursor: default; }
.o-note { font-style: italic; color: var(--rubric); }
.o-days, .o-entries { list-style: none; padding: 0; margin: 10px 0; }
.o-day, .o-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px dotted rgba(42, 33, 25, 0.3); }
.o-date { min-width: 150px; font-weight: 600; }
.o-date small { font-weight: 500; color: var(--ink-soft); }
.o-what { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.o-day.today .o-date { color: var(--rubric); }
.o-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 9px; font: 600 12px/1.5 "Cinzel", serif; letter-spacing: 0.06em;
  background: rgba(178, 58, 36, 0.12); color: var(--rubric); }
.o-goto { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.o-goto input, .o-form input, .o-form select, .o-claim input, .o-rename { font: 500 17px/1.3 "Cormorant Garamond", serif; padding: 5px 8px;
  border: 1px solid rgba(42, 33, 25, 0.35); border-radius: 3px; background: rgba(255, 250, 238, 0.7); color: var(--ink); max-width: 100%; }
.o-form { margin: 12px 0 20px; padding: 14px; border: 1px solid rgba(42, 33, 25, 0.25); border-radius: 4px; background: rgba(255, 250, 238, 0.45); }
.o-form label { display: block; margin: 8px 0; font-weight: 600; }
.o-form label input, .o-form label select { display: block; width: 100%; margin-top: 3px; font-weight: 500; }
.o-form-title { margin-top: 0; font-weight: 700; }
.o-sub { font-weight: 500; font-style: italic; color: var(--ink-soft); }
.o-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.o-name { flex: 1 1 140px; font-weight: 600; overflow-wrap: anywhere; }
.o-pts { min-width: 48px; text-align: right; }
.hidden-entry .o-name { text-decoration: line-through; opacity: 0.6; }
.o-claim { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- rules of the guild
   Pictures first, a few words each: pixel icons (assets/icons.png, tools/make_icons.py), a points bar,
   the six paintings as a tower, rank laurels, fresco swatches, short device cards. */
.ico { --i: 0; display: inline-block; flex: none; width: 48px; height: 48px; image-rendering: pixelated;
  background: url("assets/icons.png") calc(var(--i) * -48px) 0 / 480px 48px no-repeat; }
.ico.bird { width: 52px; height: 44px; background: url("assets/ascent/pigeon-sprite.png") -208px 0 / 572px 44px no-repeat; }
.rules .r-h { margin: 30px 0 12px; font: 600 15px/1.3 "Cinzel", serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rubric); text-align: center; }
.rules .r-h small { display: block; margin-top: 2px; font: italic 500 15px "Cormorant Garamond", serif; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }
.r-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; text-align: center; }
.r-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 600 17px/1.2 "Cormorant Garamond", serif; }
.r-steps li + li { position: relative; }
.r-steps li + li::before { content: "›"; position: absolute; left: -9px; top: 10px; font: 400 26px/1 "Cormorant Garamond", serif; color: var(--ink-soft); }

.r-bar { display: flex; height: 34px; border: 2px solid var(--ink); border-radius: 3px; overflow: hidden; margin: 4px 0 10px; }
.r-bar span { flex: var(--w) 0 0; display: grid; place-items: center; font: 600 15px "Cinzel", serif; color: #fff7e8; border-right: 2px solid var(--ink); }
.r-bar span:last-child { border-right: 0; }
.r-bar span:nth-child(1), .sw[style*="--k:0"] { background: #a6321f; }
.r-bar span:nth-child(2), .sw[style*="--k:1"] { background: #26437e; }
.r-bar span:nth-child(3), .sw[style*="--k:2"] { background: #b8913a; }
.r-bar span:nth-child(4), .sw[style*="--k:3"] { background: #5d7a3e; }
.r-bar span:nth-child(5), .sw[style*="--k:4"] { background: #7a5a8c; }
.rules .rubric { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 18px; }
.rules .rubric thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rules .rubric td { padding: 5px 8px 5px 0; border-bottom: 1px dotted rgba(42, 33, 25, 0.3); }
.rules .rubric td:first-child { font-weight: 700; white-space: nowrap; }
.rules .rubric td:nth-child(2) { text-align: center; color: var(--rubric); font-weight: 700; }
.rules .rubric td:last-child { font-style: italic; color: var(--ink-soft); }
.sw { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 1.5px solid var(--ink); vertical-align: -1px; }
.r-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 0; }
.r-chips span { padding: 3px 12px; border-radius: 999px; border: 1.5px solid rgba(42, 33, 25, 0.3); font: 600 16px/1.3 "Cormorant Garamond", serif; }
.r-chips .gold { border-color: #c79a2a; background: rgba(214, 170, 60, 0.18); }

.rules .levels { list-style: none; margin: 0; padding: 0; }
.tower { display: grid; gap: 6px; max-width: 440px; margin: 0 auto !important; }
.tower li { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 4px 10px 4px 4px; border: 1px solid rgba(42, 33, 25, 0.18); border-radius: 4px; background: rgba(255, 250, 236, 0.4); }
.tower img { width: 64px; height: 44px; object-fit: cover; border-radius: 2px; grid-row: 1; grid-column: 1; }
.tower .icarus-mini { width: 40px; height: auto; object-fit: contain; justify-self: center; }
.tower b { font: 600 18px/1.2 "Cormorant Garamond", serif; }
.tower b i { font: normal 600 13px "Cinzel", serif; color: #2f4f86; margin-right: 4px; }
.tower span { font: 600 18px "Cinzel", serif; color: var(--rubric); }

.ranks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.ranks li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid rgba(42, 33, 25, 0.18); border-radius: 4px; }
.ranks li:nth-child(2) .ico { opacity: 0.8; } .ranks li:nth-child(3) .ico { opacity: 0.6; } .ranks li:nth-child(4) .ico { opacity: 0.3; filter: grayscale(1); }
.ranks li:first-child { border-color: #c79a2a; background: rgba(214, 170, 60, 0.15); }
.ranks b { font: 600 15px "Cinzel", serif; }
.ranks span { font: italic 500 15px "Cormorant Garamond", serif; color: var(--ink-soft); }

.r-fresco { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 16px; text-align: center; }
.r-fresco .pf { display: block; width: 72px; height: 96px; border-radius: 3px; overflow: hidden; border: 1.5px solid rgba(42, 33, 25, 0.4); }
.r-fresco img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-fresco .grisaille img { filter: grayscale(1) contrast(0.9) brightness(1.05); }
.r-fresco .gold .pf { border-color: #c79a2a; box-shadow: 0 0 0 2px rgba(214, 170, 60, 0.45), 0 0 10px rgba(240, 200, 90, 0.5); }
.r-fresco b { display: block; margin-top: 4px; font: 600 16px "Cormorant Garamond", serif; }
.r-more { text-align: center; margin: 8px 0 0; font: 600 16px "Cormorant Garamond", serif; }
.r-more a { color: var(--rubric); }

.devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-card { margin: 0; padding: 10px 12px; border: 1px solid rgba(42, 33, 25, 0.18); border-radius: 4px; background: rgba(255, 250, 236, 0.35); scroll-margin-top: 90px; }
.device-card h3 { margin: 0; font: 600 italic 22px/1.2 "Cormorant Garamond", serif; color: var(--rubric); }
.device-card p { margin: 0 0 6px; font: 500 16px/1.3 "Cormorant Garamond", serif; color: var(--ink-soft); }
.device-card .example { margin: 0; padding: 4px 0 0 10px; border-left: 3px solid rgba(166, 50, 31, 0.5); white-space: pre-wrap;
  font: 400 16px/1.45 "IM Fell English", serif; }
.device-card:target { border-color: var(--rubric); box-shadow: 0 0 0 2px rgba(166, 50, 31, 0.25); }

.r-fair { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; }
.r-fair li { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 17px "Cormorant Garamond", serif; }
.r-fair a { color: var(--rubric); }
@media (max-width: 560px) {
  .r-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .r-steps li:nth-child(3)::before { display: none; }
  .ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .devices { grid-template-columns: minmax(0, 1fr); }
  .tower li { grid-template-columns: 56px minmax(0, 1fr) auto; }
}

/* ---------------------------------------------------------------- the weekly fresco */
.fresco { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.panel { margin: 0; min-width: 0; }
.panel .art, .panel .plaster { position: relative; aspect-ratio: 3 / 4; border-radius: 3px; overflow: hidden;
  border: 3px solid #d9caa8; box-shadow: 0 0 0 1px rgba(42, 33, 25, 0.35), inset 0 0 18px rgba(42, 33, 25, 0.25); }
.panel .art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.panel .art .icarus-mini { position: absolute; left: 6%; top: 30%; width: 88%; height: auto; object-fit: contain; z-index: 1;
  filter: sepia(0.35) drop-shadow(0 4px 6px rgba(90, 50, 10, 0.35)); }
.panel.grisaille .art img { filter: grayscale(1) sepia(0.25) contrast(0.92) brightness(1.06); }
.panel.gold .art { border-color: #c9a23a; box-shadow: 0 0 0 1px #7d5f17, 0 0 16px rgba(214, 172, 58, 0.6); }
.panel.gold .art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 226, 140, 0.35), rgba(255, 255, 255, 0) 45%, rgba(214, 172, 58, 0.3)); mix-blend-mode: screen; }
.panel .plaster { background: rgba(42, 33, 25, 0.05); border-style: dashed; border-color: rgba(42, 33, 25, 0.25); box-shadow: none; }
.panel.future .plaster { opacity: 0.45; }
.panel .cap { margin: 5px 0 0; text-align: center; font: 500 15px/1.25 "Cormorant Garamond", serif; color: var(--ink-soft); }
.panel .cap b { display: block; color: var(--ink); font-weight: 700; }
.panel .cap strong { display: block; color: var(--rubric); font-weight: 700; }
.panel .cap span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel .cap .dev { font-size: 13px; font-style: italic; }
.panel.gold .cap strong { color: #9a7414; }
.rank-line { text-align: center; font: 500 18px/1.45 "Cormorant Garamond", serif; margin: 4px 0; }
.rank-line b { color: var(--rubric); font: 600 17px "Cinzel", serif; letter-spacing: 0.06em; }
.fresco-key { margin-top: 18px; padding-top: 14px; border-top: 1.5px solid rgba(42, 33, 25, 0.16); text-align: center;
  font: italic 500 16.5px/1.5 "Cormorant Garamond", serif; color: var(--ink-soft); }
.fresco-key a { color: var(--rubric); font-weight: 600; }
.fresco-key .k { font-style: normal; font-weight: 600; color: var(--ink); }
.fresco-key .k.gold { color: #9a7414; }
@media (max-width: 600px) {
  .fresco { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .panel .cap { font-size: 14px; }
  .panel .cap .dev { display: none; }
}

/* owner's desk: gift a skin (one small bird button each; filled in when the player already has it) */
.o-gifts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.o-has { display: inline-flex; gap: 2px; }
.o-has .o-bird { width: 26px; height: 22px; background-size: 286px 22px; background-position: -104px 0; }
.o-pick { font: 500 15px "Cormorant Garamond", serif; padding: 5px 6px; border: 1px solid rgba(42, 33, 25, 0.35); border-radius: 3px; background: rgba(255, 250, 236, 0.6); }
.o-gift { width: 40px; height: 34px; padding: 0; border: 1px solid rgba(42, 33, 25, 0.35); border-radius: 3px; background: transparent; cursor: pointer; }
.o-gift:hover:not(:disabled) { background: rgba(214, 170, 60, 0.2); }
.o-gift.has { cursor: default; background: rgba(93, 122, 62, 0.15); border-color: rgba(93, 122, 62, 0.6); }
.o-bird { display: block; width: 39px; height: 33px; margin: 0 auto; image-rendering: pixelated;
  background: no-repeat -156px 0 / 429px 33px; }
.o-gift:not(.has) .o-bird { opacity: 0.55; }
