/* Foton's Slops — the site's own interface: a lighter, bilingual design over the inherited layout.
   Typography from the classic journal (Cormorant Garamond + Noto Serif TC; no IM Fell),
   journal-page panels in parchment and ink, an astrolabe for navigation, a slim rail of tools. */

:root {
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, var(--cjk);
  --display: "Cormorant Garamond", Georgia, var(--cjk);
  --gold: #c9a063; --line: #c9a06359;
  --parch: #efe6d2; --parch-2: #e6d9bd; --ink-d: #2a2118; --ink-m: #6b5a44; --seal: #b23a2a;
}
h1, h2, h3, .brand, .label, .tip-name, #panel h2 { font-family: var(--display); }

/* ── opening screen: an orrery, the title, both languages side by side ── */
#intro { background: radial-gradient(ellipse at 50% 55%, #1a1222ee 0%, #07050bf5 70%); }
.orrery { position: absolute; inset: 0; overflow: hidden; opacity: .9; pointer-events: none; }
.orrery svg { width: 100%; height: 100%; }
.o-ring { transform-origin: 0 0; animation: o-spin linear infinite; }
@keyframes o-spin { to { transform: rotate(360deg); } }
.intro-inner { position: relative; max-width: 760px; }
.intro-inner h1 { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: clamp(40px, 7vw, 82px); color: #f6e9cc; text-shadow: 0 0 50px #e2b8664d; }
.intro-inner .over, .intro-inner .sub, #enter { display: flex; justify-content: center; align-items: baseline; gap: 0 18px; flex-wrap: wrap; }
.intro-inner .over { letter-spacing: .28em; font-size: 13px; }
.intro-inner .sub { font-style: normal; font-size: 19px; color: #d8c8a8; margin-top: 16px; }
.intro-inner .sub .o, .intro-inner .over .o { opacity: .75; }
.prologue-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 30px 0 26px; text-align: left; }
.prologue-pair .prologue { margin: 0; font-size: 17px; line-height: 1.6; font-style: normal; color: #eadcc0; }
.prologue-pair .prologue.other { color: #b9a988; border-left: 1px solid var(--line); padding-left: 26px; }
html[data-lang="zh"] .prologue-pair .prologue:not(.other), html[data-lang="en"] .prologue-pair .prologue.other { letter-spacing: .04em; }
#enter { display: inline-flex; font-family: var(--display); font-weight: 600; letter-spacing: .12em; padding: 13px 38px; border-radius: 999px; border: 1px solid var(--gold);
  background: radial-gradient(circle at 50% 120%, #e2b86633, #e2b8660a 60%); }
#enter .o { font-weight: 400; opacity: .8; }
@media (width <= 760px) { .prologue-pair { grid-template-columns: 1fr; gap: 12px; } .prologue-pair .prologue.other { border-left: 0; padding-left: 0; } }

/* ── top: the name on the left, a slim rail of round tools down the right ── */
header#top { background: none; align-items: flex-start; padding: 16px 20px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.brand .b-en { font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 21px; color: #f6e9cc; }
.brand .b-sub { display: flex; gap: 10px; font-size: 12.5px; letter-spacing: .08em; color: #cdbb98; margin-top: 4px; }
.brand .b-sub .o { opacity: .7; }
.tools.rail { position: fixed; top: 14px; right: 14px; flex-direction: column; gap: 7px; }
.tools.rail button, .tools.rail a.btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: #120c16b8; border: 1px solid var(--line); color: #eadcc0; text-decoration: none; }
.tools.rail button:hover, .tools.rail a.btn:hover, .tools.rail .on { border-color: var(--gold); color: #ffe7b5; box-shadow: 0 0 14px #e2b86640; }
#btn-tour { font-size: 0 !important; }
.tools.rail .ri { width: 19px; height: 19px; display: block; }
.tools.rail .sep { width: 18px; height: 1px; margin: 2px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .55; }
.tools.rail #btn-hold.on { background: #3a2a14d0; }               /* anchored: the anchor stays lit */
#btn-sound.off .ri { opacity: .45; } #btn-sound.off { text-decoration: none; }
#btn-lang { font-size: 13px !important; font-family: var(--cjk); }
.tools.rail a.btn { display: grid !important; }

/* ── the astrolabe ── */
#astrolabe { position: fixed; left: 18px; bottom: 18px; width: 236px; height: 236px; z-index: 11; transition: opacity .6s; }
#astrolabe.hidden { display: block !important; opacity: 0; pointer-events: none; }
#astrolabe::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #160f1ce6 0 62%, #120c16b0 63% 100%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 40px #0009, inset 0 0 0 1px #c9a06333; }
.a-fixed { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.a-ring { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 1.4s cubic-bezier(.3,.7,.2,1); }
.a-glyphs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.a-city { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #1c1424; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); color: var(--c); font-size: 14px;
  transition: transform 1.4s cubic-bezier(.3,.7,.2,1), box-shadow .3s, background .3s; }
.a-city:hover, .a-city.on { background: color-mix(in srgb, var(--c) 28%, #1c1424); box-shadow: 0 0 14px var(--c); }
.a-city.on { width: 34px; height: 34px; left: -17px; top: -17px; }
.a-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 118px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.a-lib { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.a-lib .photon { width: 10px; height: 10px; border-radius: 50%; background: #fff1cf; box-shadow: 0 0 10px 4px #e2b866aa, 0 0 26px 8px #e2b86644; animation: a-pulse 3.2s ease-in-out infinite; }
@keyframes a-pulse { 50% { box-shadow: 0 0 14px 6px #e2b866cc, 0 0 34px 12px #e2b86655; } }
.a-where { font-family: var(--display); line-height: 1.1; min-height: 2.3em; }
.a-where b { display: block; font-weight: 600; font-size: 14px; color: #f6e9cc; }
.a-where small { display: block; font-size: 12px; color: #c6b48f; }
#astrolabe #layouts { background: none; border: 0; padding: 0; gap: 2px; backdrop-filter: none; }
#astrolabe #layouts button { padding: 2px 8px; font-size: 12.5px; border-radius: 10px; }
#astrolabe #layouts button small { display: none; }
#astrolabe #layouts button.on { background: #e2b86633; color: #ffe7b5; }
body.reading #astrolabe, body.solo #astrolabe { opacity: 0; pointer-events: none; }
@media (width <= 860px) {
  #astrolabe { width: 168px; height: 168px; left: 8px; bottom: 8px; }
  .a-glyphs { transform: scale(.7); } .a-core { width: 92px; } .a-where b { font-size: 12px; } .a-where small { font-size: 11px; }
  .tools.rail { gap: 5px; } .tools.rail button, .tools.rail a.btn { width: 32px; height: 32px; font-size: 14px; }
  body.focused #astrolabe { opacity: 0; pointer-events: none; }
}

/* ── labels: both names, the chosen language first ── */
.label .sub { flex-basis: 100%; text-align: center; font-family: var(--display); font-size: 13px; letter-spacing: .03em; text-transform: none; color: #d9c7a2; opacity: .9; margin: -3px 0 0; }
.label .n { font-weight: 600; }

/* ── the city panel: a page from the journal ── */
#panel { background: linear-gradient(180deg, #f3ead6 0%, var(--parch) 40%, var(--parch-2) 100%); color: var(--ink-d); border: 0; border-radius: 6px 14px 14px 6px;
  box-shadow: 0 24px 60px #000b, inset 10px 0 18px -12px #7a5a3a66, inset 0 0 0 1px #b8955a55;
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, #b8955a1c 31px 32px), linear-gradient(180deg, #f3ead6, var(--parch) 40%, var(--parch-2)); }
#panel::before { background: linear-gradient(90deg, transparent, var(--c), transparent); top: 0; height: 3px; }
#panel .close { color: var(--ink-m); } #panel .close:hover { color: var(--ink-d); }
.meta { color: var(--ink-m); }
#panel .cat { color: color-mix(in srgb, var(--c) 55%, var(--ink-d)); position: relative; padding-right: 54px; }
#panel .cat .seal { position: absolute; right: 2px; top: -12px; width: 40px; height: 40px; display: grid; place-items: center; font-family: var(--cjk); font-weight: 600; font-size: 24px;
  color: #fff3e6; background: var(--seal); border-radius: 5px; transform: rotate(-4deg); box-shadow: inset 0 0 0 2px #fff3e655, 0 1px 0 #0003; letter-spacing: 0; }
#panel h2 { color: var(--ink-d); font-weight: 600; font-size: 44px; line-height: 1.02; }
#panel h2 small, #panel .motif small { display: block; font-weight: 500; color: var(--ink-m); }
#panel h2 small { font-size: 26px; margin-top: 4px; }
#panel .motif { color: #5a4630; font-style: italic; }
#panel .motif small { font-size: 16px; margin-top: 4px; font-style: normal; }
html[data-lang="zh"] #panel h2 { font-size: 40px; }
#panel .text { color: var(--ink-d); }
#panel .text p.city-intro { color: #4a3a28; }
.post-list button { background: transparent; border: 0; border-bottom: 1px dotted #9c7d5266; border-left: 0; border-radius: 0; padding: 8px 4px; }
.post-list button:hover, .post-list button:focus-visible { background: #b8955a22; transform: none; border-bottom-color: #9c7d52; }
.post-list time { color: var(--ink-m); }
.post-list b { color: var(--ink-d); }
.post-list button.was-read b { color: #6b5a44; }
.post-list i { color: color-mix(in srgb, var(--c) 60%, var(--ink-d)); }
em.read { color: #7a6a52; }
.nav button { color: var(--ink-m); } .nav button:hover { color: var(--ink-d); }
.progress { background: #b8955a33; }
#panel .text { -webkit-mask-image: none; mask-image: none; }

/* ── overlays and tooltip on parchment too ── */
.overlay-inner, #tip { background: linear-gradient(180deg, #f3ead6, var(--parch-2)); color: var(--ink-d); border: 1px solid #b8955a66; box-shadow: 0 30px 90px #000b; }
#tip { border-left: 4px solid var(--c); }
.tip-cat { color: color-mix(in srgb, var(--c) 55%, var(--ink-d)); } .tip-name { color: var(--ink-d); font-weight: 600; } .tip-motif { color: var(--ink-m); }
.overlay h3 { color: var(--ink-d); font-weight: 600; }
.overlay .close { color: var(--ink-m); }
.lede, .small, #f-toc h4 small { color: var(--ink-m); }
#f-toc h4 button { color: var(--ink-d); font-weight: 600; }
#f-toc li button { color: #3a2e20; }
#f-toc li button:hover, #f-toc li button:focus-visible { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--ink-d); }
kbd { border-color: #b8955a88; background: #fff8e8; color: var(--ink-d); }
.keys { color: var(--ink-d); }
#f-quality button { color: var(--ink-m); } #f-quality button.on { color: var(--seal); }
.help-classic { color: var(--seal) !important; }
#s-input { background: #fff8e8; border-color: #b8955a88; color: var(--ink-d); }
#s-list button b { color: var(--ink-d); } #s-list button i, #s-list button time { color: var(--ink-m); }
#s-list button.sel, #s-list button:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.il-kicker { color: var(--seal); } .il-text { color: #3a2e20; }
#il-go { color: var(--ink-d); border-color: var(--seal); } #il-go:hover { background: #b23a2a18; }
#interlude .overlay-inner { background: linear-gradient(180deg, #f3ead6, var(--parch-2)); }
#f-toast { background: #f3ead6; color: var(--ink-d); border-color: #b8955a88; }
#f-toast a { color: var(--seal); }

/* keep the journal page clear of the tool rail */
#panel { right: 66px; }
@media (width <= 860px) { #panel { right: 10px; left: 10px; } }

/* ── Newest writing: a journal slip at the foot of the screen (foton-camera.js) ── */
#latest { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 11; width: min(520px, calc(100vw - 28px));
  background: linear-gradient(180deg, #f3ead6, var(--parch) 45%, var(--parch-2)); color: var(--ink-d); border-radius: 6px 14px 14px 6px;
  padding: 14px 22px 12px; box-shadow: 0 18px 50px #0008, inset 3px 0 0 var(--c, var(--gold)); text-align: center; animation: lt-in .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lt-in { from { opacity: 0; transform: translate(-50%, 14px); } }
#latest .lt-k { margin: 0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--seal); }
#latest .lt-t { margin: 4px 0 0; font-family: var(--display); font-weight: 600; font-size: 27px; line-height: 1.12; }
#latest .lt-o { margin: 2px 0 0; font-size: 16px; color: var(--ink-m); min-height: 0; }
#latest .lt-o:empty { display: none; }
#latest .lt-m { margin: 6px 0 8px; font-size: 14px; color: var(--ink-m); font-style: italic; }
#latest .lt-b { display: flex; justify-content: center; gap: 10px; }
#latest .lt-b button { font: inherit; font-size: 15px; padding: 4px 16px; border-radius: 999px; border: 1px solid #b8955a88; color: var(--ink-d); background: #fff6; cursor: pointer; }
#latest .lt-b .lt-read { background: var(--ink-d); color: #f6ecd6; border-color: var(--ink-d); }
#latest .lt-b button:hover { border-color: var(--seal); }
#latest .lt-p { height: 2px; margin-top: 10px; background: #b8955a33; border-radius: 2px; overflow: hidden; }
#latest .lt-p i { display: block; height: 100%; width: 0; background: var(--c, var(--gold)); }
body.latest-on #astrolabe, body.latest-on #legend { opacity: .25; }
@media (max-width: 860px) { #latest { bottom: auto; top: 64px; } #latest .lt-t { font-size: 22px; } }
body.focused #latest { left: calc((100vw - 450px) / 2); } @media (max-width: 860px) { body.focused #latest { left: 50%; } }

/* ── Travel: the chooser beside the rail (craft by name, and the train) ── */
#travel { position: fixed; z-index: 15; top: 120px; right: 64px; width: 250px; max-height: calc(100vh - 140px); overflow-y: auto;
  background: linear-gradient(180deg, #f3ead6, var(--parch) 40%, var(--parch-2)); color: var(--ink-d); border-radius: 12px 6px 12px 12px;
  padding: 12px 12px 10px; box-shadow: 0 18px 50px #0009; animation: lt-in .35s ease both; font-family: var(--serif); }
#travel h4 { margin: 0 4px 6px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--seal); font-weight: 600; }
#travel .t-group { margin: 6px 0 2px; }
#travel .t-kind { display: block; margin: 0 4px 2px; font-size: 12px; letter-spacing: .08em; color: var(--ink-m); font-style: italic; }
#travel button { display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 8px; width: 100%; text-align: left; padding: 5px 8px;
  border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-d); cursor: pointer; font: inherit; }
#travel button .ri { width: 20px; height: 20px; grid-row: span 2; color: #6b5a44; }
#travel button b { font-size: 16px; font-weight: 600; line-height: 1.1; }
#travel button small { font-size: 12px; color: var(--ink-m); }
#travel button:hover { background: #fff7; border-color: #b8955a66; }
#travel button.on { background: #e9d9b4; border-color: var(--gold); }
#travel .t-train b { color: #1f2a4a; }
#travel .t-off, #travel .t-any { display: block; text-align: center; margin-top: 6px; border-color: #b8955a66; font-size: 14px; }
#travel .t-off { background: var(--ink-d); color: #f6ecd6; margin: 0 0 6px; }
@media (max-width: 860px) { #travel { right: 50px; top: 70px; width: 220px; } }

/* ── Settings: one parchment panel beside the rail for everything about the sky and the picture ── */
#settings { position: fixed; z-index: 16; top: 120px; right: 64px; width: 330px; max-height: calc(100vh - 140px); overflow-y: auto;
  background: linear-gradient(180deg, #f3ead6, var(--parch) 40%, var(--parch-2)); color: var(--ink-d); border-radius: 12px 6px 12px 12px;
  padding: 10px 14px 12px; box-shadow: 0 18px 50px #0009; animation: lt-in .35s ease both; font-family: var(--serif); }
#settings header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#settings h4 { margin: 0; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--seal); font-weight: 600; }
#settings .close { position: static; background: none; border: 0; color: var(--ink-m); font-size: 22px; line-height: 1; padding: 0 2px; cursor: pointer; }
#settings .s-row { padding: 5px 0 5px; border-top: 1px solid #b8955a33; }
#set-body > :first-child, #set-body > :first-child .s-row { border-top: 0; }
#settings .s-pair { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; border-top: 1px solid #b8955a33; }
#settings .s-pair .s-row { border-top: 0; }
#settings .s-pair .seg button { padding: 4px 6px; }
#settings .s-lab { display: block; font-size: 12px; letter-spacing: .08em; color: var(--ink-m); font-style: italic; margin: 0 0 4px 2px; }
#settings .seg { display: flex; flex-wrap: wrap; gap: 4px; }
#settings .seg button { flex: 1 1 auto; padding: 3px 9px; border-radius: 7px; border: 1px solid #b8955a55; background: #fff5; color: var(--ink-d);
  font: 15px/1.2 var(--serif); cursor: pointer; white-space: nowrap; }
#settings .seg button i { font-style: normal; margin-right: 4px; color: #8a6a3a; }
#settings .seg button:hover { background: #fff9; }
#settings .seg button.on { background: var(--ink-d); color: #f6ecd6; border-color: var(--ink-d); }
#settings .seg button.on i { color: #e8c98e; }
#settings .s-link { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 7px 10px;
  border-radius: 8px; border: 1px solid #b8955a66; background: #e9d9b4; color: var(--ink-d); font: 15px var(--serif); cursor: pointer; }
#settings .s-link svg { width: 18px; height: 18px; }
#settings .s-link:hover { background: #f1e3c2; }
@media (max-width: 860px) { #settings { right: 50px; top: 64px; width: min(330px, calc(100vw - 64px)); } }

/* ── Phones (0.21): a slimmer header, the city page as a bottom sheet that folds, a ring for touch-and-hold ── */
#hold-ring { position: fixed; z-index: 30; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none;
  border: 2px solid #f0d9a0; box-shadow: 0 0 18px #f0d9a088; opacity: 0; transform: scale(.3); }
#hold-ring.grow { animation: hold-grow .52s linear forwards; }
#hold-ring.fire { opacity: 1; transform: scale(1); animation: hold-fire .45s ease-out forwards; }
@keyframes hold-grow { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 0; } 100% { opacity: .9; transform: scale(1); } }
@keyframes hold-fire { to { opacity: 0; transform: scale(1.6); } }
.sheet-handle { display: none; }
@media (width <= 600px) {
  header#top { padding: 12px 14px; }
  .brand .b-en { font-size: 19px; letter-spacing: .16em; }
  .brand .b-sub { display: none; }
  .tools.rail { top: 10px; right: 8px; gap: 4px; }
  .tools.rail button, .tools.rail a.btn { width: 34px; height: 34px; }
  .tools.rail .sep { margin: 1px 0; }
  .label .cnt, .label .nb { display: none; }
  .label .n { font-size: 15px; }
  #astrolabe { width: 132px; height: 132px; left: 6px; bottom: 6px; }
  .a-glyphs { transform: scale(.56); } .a-core { width: 74px; } .a-where b { font-size: 11px; } .a-where small { display: none; }
  #panel { left: 6px !important; right: 6px !important; bottom: 6px !important; top: auto !important; height: auto !important; max-height: 50vh;
    padding: 16px 16px 10px !important; border-radius: 16px 16px 10px 10px; transition: max-height .35s ease; overflow: hidden; }
  #panel h2 { font-size: 30px; }
  #panel .text { min-height: 0; }
  #panel .text { font-size: 16px; }
  .sheet-handle { display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 84px; height: 18px;
    border: 0; background: none; padding: 0; cursor: pointer; z-index: 2; }
  .sheet-handle::before { content: ''; display: block; width: 42px; height: 4px; margin: 6px auto 0; border-radius: 3px; background: #8a6a3a66; }
  body.sheet-min #panel { max-height: 132px; }
  #p-order { display: none; }
  body.sheet-min #panel .text, body.sheet-min #panel .motif, body.sheet-min #panel .nav, body.sheet-min #panel .progress { display: none; }
  body.sheet-min #panel h2 { font-size: 26px; margin: 2px 0 0; }
  #settings, #travel { right: 48px; top: 52px; max-height: calc(100vh - 70px); }
  #settings { width: calc(100vw - 60px); padding: 8px 10px 10px; }
  #settings .seg button { font-size: 14px; padding: 3px 6px; }
  #latest { width: calc(100vw - 20px) !important; }
  #f-toast { width: calc(100vw - 24px); text-align: center; border-radius: 14px; font-size: 14px; bottom: 12px; }
}

/* ── Photo mode (0.22): only the sky and the cities, and a small bar to take the picture ── */
body.photo header#top, body.photo #labels, body.photo #astrolabe, body.photo #panel, body.photo #legend, body.photo #tip, body.photo #latest,
body.photo .caption, body.photo #travel, body.photo #settings { opacity: 0 !important; pointer-events: none !important; }
#photo { position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px;
  background: #0d0a12cc; border: 1px solid #e2b86655; border-radius: 30px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px #0008; transition: opacity .3s; }
#photo button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid #e2b86633;
  background: #ffffff0d; color: #f3e7d0; font: 15px var(--serif); cursor: pointer; }
#photo button svg { width: 19px; height: 19px; }
#photo button:hover { background: #ffffff1f; }
#photo button.on { border-color: #e2b866; color: #f0d9a0; }
#photo .shutter { background: #f3ead6; color: #1c1420; border-color: #f3ead6; font-weight: 600; }
#photo .shutter:hover { background: #fff; }
#photo button[data-p="exit"] { width: 40px; padding: 0; justify-content: center; font-size: 22px; }
body.photo #photo:not(:hover) { opacity: .55; }
#photo-flash { position: fixed; inset: 0; z-index: 39; background: #fff; opacity: 0; pointer-events: none; }
#photo-flash.go { animation: photo-flash .5s ease-out; }
@keyframes photo-flash { 0% { opacity: .75; } 100% { opacity: 0; } }
@media (width <= 600px) { #photo button span { display: none; } #photo button { padding: 0 12px; } #photo .shutter span { display: inline; } }
#intro .loader:not(.started) .bar { width: 30% !important; animation: load-wait 1.6s ease-in-out infinite; }
@keyframes load-wait { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* ── Each city's colour on its label (0.23) ── */
.label.tinted .n { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c) 75%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px;
  text-shadow: 0 0 12px color-mix(in srgb, var(--c) 55%, transparent), 0 1px 3px #000c; }
body.night .label.tinted .n, .night .label.tinted .n { text-shadow: 0 0 16px var(--c), 0 1px 3px #000c; }
#storm-flash { position: fixed; inset: 0; background: #e8ecff; pointer-events: none; z-index: 3; opacity: 0; mix-blend-mode: screen; }

/* ── Map (0.23): a round chart of the sky, top left ── */
#minimap { position: fixed; z-index: 8; left: 18px; top: 74px; width: 164px; height: 164px; border-radius: 50%; box-shadow: 0 8px 30px #0008; transition: opacity .4s; }
#minimap canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
body.photo #minimap, body.reading #minimap, body.timeline #minimap { opacity: 0; pointer-events: none; }
@media (width <= 600px) { #minimap { width: 112px; height: 112px; top: 50px; left: 8px; } body.has-map #astrolabe { display: none; } }

/* ── Timeline ── */
#timeline { position: fixed; z-index: 40; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: #0d0a12d9; border: 1px solid #e2b86655; border-radius: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 40px #0008; color: #f3e7d0; font-family: var(--serif); }
#timeline button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid #e2b86655; background: #ffffff10; color: #f0d9a0; cursor: pointer; display: grid; place-items: center; font-size: 22px; }
#timeline .tl-play { background: #f3ead6; color: #1c1420; }
#timeline button svg { width: 20px; height: 20px; }
#timeline .tl-mid { flex: 1; min-width: 0; }
#timeline .tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#timeline .tl-head b { font-size: 19px; font-weight: 600; letter-spacing: .03em; }
#timeline .tl-head span { font-size: 14px; color: #d8c9a8; font-style: italic; }
#timeline input[type=range] { width: 100%; accent-color: #e2b866; margin: 4px 0 2px; }
#timeline .tl-new { font-size: 14px; color: #e8dcc4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 18px; }
body.timeline #panel, body.timeline #latest, body.timeline #legend { opacity: 0; pointer-events: none; }

/* ── Passport ── */
#passport { position: fixed; z-index: 30; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: linear-gradient(180deg, #f3ead6, var(--parch) 40%, var(--parch-2)); color: var(--ink-d); border-radius: 14px; padding: 14px 18px 16px; box-shadow: 0 30px 80px #000a; font-family: var(--serif); animation: lt-in .35s ease both; }
#passport header { display: flex; justify-content: space-between; align-items: center; }
#passport h4 { margin: 0; font-size: 15px; letter-spacing: .22em; text-transform: uppercase; color: var(--seal); }
#passport h4 small { letter-spacing: .05em; color: var(--ink-m); margin-left: 6px; }
#passport h5 { margin: 14px 0 6px; font-size: 13px; letter-spacing: .12em; color: var(--ink-m); font-weight: 600; }
#passport .close { background: none; border: 0; font-size: 24px; color: var(--ink-m); cursor: pointer; }
#passport .pp-sub { margin: 4px 0 10px; font-style: italic; color: var(--ink-m); font-size: 15px; }
#passport .pp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
#passport .pp-c { background: none; border: 0; padding: 2px; display: flex; flex-direction: column; align-items: center; cursor: pointer; color: var(--ink-d); font-family: inherit; }
#passport .seal { width: 86px; height: 86px; transform: rotate(var(--r)); opacity: .32; transition: transform .2s; }
#passport .seal.st { width: 104px; height: 70px; }
#passport .seal.got { opacity: .92; filter: url(#ink) saturate(1.1); mix-blend-mode: multiply; }
#passport .pp-c:hover .seal { transform: rotate(var(--r)) scale(1.06); }
#passport .pp-n { font-size: 14px; margin-top: 2px; text-align: center; line-height: 1.15; }
#passport .pp-d { font-size: 12px; color: var(--ink-m); font-style: italic; }
#passport .pp-about { margin: 14px 0 6px; font-size: 14px; color: var(--ink-m); }
#passport .pp-about a { color: var(--seal); }
#passport .pp-reset { background: none; border: 1px solid #b8955a55; border-radius: 8px; padding: 3px 10px; color: var(--ink-m); font: 13px var(--serif); cursor: pointer; }
@media (width <= 600px) { #passport .pp-grid { grid-template-columns: repeat(3, 1fr); } #passport .seal { width: 72px; height: 72px; } }
#btn-passport.stamped { animation: stamp-pop .6s ease; }
@keyframes stamp-pop { 30% { transform: scale(1.3); box-shadow: 0 0 18px #f0d9a0; } }
@media (width <= 600px) {
  .tools.rail #btn-lang, .tools.rail a[data-classic] { display: none !important; }
  .tools.rail #btn-help { display: grid !important; }
  .tools.rail button, .tools.rail a.btn { width: 32px; height: 32px; }
  .tools.rail { gap: 3px; }
  #panel { max-height: 43vh; }
}

/* ── For everyone (0.24): skip link, visible focus, the plain list ── */
.skip { position: fixed; z-index: 100; left: 12px; top: -60px; padding: 8px 14px; border-radius: 8px; background: #f3ead6; color: #1c1420; font: 16px var(--serif); transition: top .2s; }
.skip:focus { top: 12px; outline: 2px solid #e2b866; }
:focus-visible { outline: 2px solid #f0d9a0 !important; outline-offset: 2px; }
.label[role=button]:focus-visible { outline-offset: 6px; border-radius: 6px; }
button.linkish { background: none; border: 0; padding: 0; color: var(--seal, #b8442e); font: inherit; text-decoration: underline; cursor: pointer; }
#a11y-list { position: fixed; z-index: 60; inset: 4vh max(12px, calc(50vw - 360px)); overflow-y: auto; background: linear-gradient(180deg, #f3ead6, var(--parch) 40%, var(--parch-2));
  color: var(--ink-d); border-radius: 14px; padding: 14px 22px 22px; box-shadow: 0 30px 80px #000c; font-family: var(--serif); }
#a11y-list header { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -14px; background: #f3ead6; padding: 6px 0; }
#a11y-list h2 { margin: 0; font-size: 26px; }
#a11y-list h3 { margin: 18px 0 4px; font-size: 20px; }
#a11y-list ul { margin: 0; padding-left: 20px; }
#a11y-list li { margin: 3px 0; font-size: 16px; }
#a11y-list a { color: var(--ink-d); }
#a11y-list time { color: var(--ink-m); font-size: 13px; margin-left: 4px; }
#a11y-list .close { background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--ink-m); }
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ── First-visit hints ── */
#hint { position: fixed; z-index: 70; width: 290px; padding: 14px 16px 12px; border-radius: 14px; background: #f3ead6; color: #1c1420; box-shadow: 0 16px 50px #000b;
  font-family: var(--serif); animation: lt-in .3s ease both; }
#hint p { margin: 0 0 10px; font-size: 17px; line-height: 1.35; }
#hint .h-row { display: flex; align-items: center; gap: 6px; }
#hint .h-dots { flex: 1; display: flex; gap: 4px; }
#hint .h-dots i { width: 6px; height: 6px; border-radius: 50%; background: #b8955a66; }
#hint .h-dots i.on { background: #b8442e; }
#hint button { border: 1px solid #b8955a66; background: none; border-radius: 8px; padding: 4px 10px; font: 14px var(--serif); color: #4a3a2a; cursor: pointer; }
#hint .h-next { background: #1c1420; color: #f3ead6; border-color: #1c1420; }
#hint.pos-left::after, #hint.pos-below::after { content: ''; position: absolute; width: 12px; height: 12px; background: #f3ead6; transform: rotate(45deg); }
#hint.pos-left::after { right: -6px; top: calc(50% - 6px); }
#hint.pos-below::after { top: -6px; left: 24px; }
#hint-ring { position: fixed; z-index: 69; pointer-events: none; border: 2px solid #f0d9a0; box-shadow: 0 0 0 9999px #0006, 0 0 22px #f0d9a0aa; transition: all .35s ease; }
#hint-ring.hidden, #hint.hidden { display: none; }
/* the picture just taken, with Save and Share (0.24.2) */
#photo-card { position: fixed; z-index: 45; left: 50%; bottom: 86px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); padding: 10px;
  background: #0d0a12e6; border: 1px solid #e2b86666; border-radius: 16px; box-shadow: 0 16px 50px #000a; animation: lt-in .3s ease both; font-family: var(--serif); }
#photo-card img { display: block; width: 100%; border-radius: 9px; }
#photo-card .pc-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
#photo-card .pc-size { flex: 1; font-size: 13px; color: #cdbf9f; font-style: italic; }
#photo-card button, #photo-card .pc-save { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #e2b86655;
  background: #ffffff10; color: #f3e7d0; font: 15px var(--serif); cursor: pointer; text-decoration: none; }
#photo-card button svg { width: 17px; height: 17px; }
#photo-card .pc-save { background: #f3ead6; color: #1c1420; border-color: #f3ead6; font-weight: 600; }
#photo-card .pc-x { width: 36px; padding: 0; justify-content: center; font-size: 20px; }
body:not(.photo) #photo-card { display: none; }
