/* Shard of Light: a day of memory. The page's one signature surface is the series' own blue window
   (a deep gradient inside a fine double border). Titles are carved in Marcellus, like the series'
   logos; narration is EB Garamond, upright; the windows' small print is Figtree. No italics. Colour
   comes from the sky. */
.shard_wrap {
  --sh-ink: #f4f6fb; --sh-soft: rgba(244, 246, 251, .8); --sh-dim: rgba(244, 246, 251, .6);
  --sh-win-top: rgba(46, 70, 168, .76); --sh-win-bot: rgba(12, 18, 64, .88); --sh-win-line: rgba(236, 241, 255, .86);
  --sh-accent: #cfe0ff;
  --sh-display: 'FF Marcellus', 'Marcellus', 'Optima', serif; --sh-serif: 'FF Garamond', 'EB Garamond', Garamond, serif; --sh-sans: 'FF Figtree', 'Figtree', system-ui, sans-serif;
  --sh-gutter: clamp(18px, 2.4vw, 36px); --sh-glide: cubic-bezier(.65, 0, .25, 1);
  position: relative; height: 100svh; overflow: hidden; background: #0d1530; color: var(--sh-ink); font-family: var(--sh-sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.shard_wrap[data-beat="wind"] { --sh-accent: #9ff2cf; }
.shard_wrap[data-beat="magi"] { --sh-accent: #ffc2e9; }
.shard_wrap[data-beat="world"] { --sh-accent: #ffc79e; }
.shard_wrap[data-beat="lucis"] { --sh-accent: #c6bcff; }
.shard_wrap[data-beat="farplane"] { --sh-accent: #b6efff; }
.shard_wrap[data-beat="roll"] { --sh-accent: #d9e4ff; }
.shard_wrap .shard_contain { position: relative; width: 100%; height: 100%; overflow: hidden; }
.shard_wrap button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.shard_wrap a { color: inherit; text-decoration: none; }
.shard_wrap .shard_world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.8s var(--sh-glide); }
.shard_wrap.is-in .shard_world { opacity: 1; }
/* Trance: the screen flushes rose as she wakes */
.shard_wrap .shard_contain::after { content: ''; position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: var(--trance, 0);
  background: radial-gradient(70% 70% at 30% 45%, rgba(255, 235, 245, .95), rgba(255, 120, 200, .65) 35%, rgba(200, 40, 140, .35) 70%, rgba(60, 10, 50, .4)); mix-blend-mode: screen; }

/* the series' window: a blue that deepens downward, held by a fine double border */
.shard_wrap .shard_window {
  position: relative; border-radius: 9px; background: linear-gradient(180deg, var(--sh-win-top), var(--sh-win-bot));
  box-shadow: inset 0 0 0 1.5px var(--sh-win-line), inset 0 0 0 3px rgba(10, 14, 40, .6), inset 0 0 0 3.6px rgba(236, 241, 255, .2), 0 18px 40px -18px rgba(4, 8, 30, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---- chrome ---- */
.shard_wrap .shard_top { position: absolute; z-index: 20; inset: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; padding: var(--sh-gutter); opacity: 0; transition: opacity 1.2s .6s; pointer-events: none; }
.shard_wrap.is-in .shard_top { opacity: 1; }
.shard_wrap .shard_top > * { pointer-events: auto; }
.shard_wrap .shard_brand { display: flex; align-items: center; gap: 14px; padding-top: 6px; }
.shard_wrap .shard_brand_mark { display: block; width: 18px; height: 28px; }
.shard_wrap .shard_brand_mark svg { width: 100%; height: 100%; overflow: visible; }
.shard_wrap .shard_brand_mark path { fill: none; stroke: currentColor; stroke-linejoin: miter; }
.shard_wrap .shard_brand_word { font-family: var(--sh-display); font-size: 15px; letter-spacing: .26em; text-transform: uppercase; }
.shard_wrap .shard_menu { position: relative; }
.shard_wrap .shard_menu_btn { padding: 11px 24px 12px; font-size: 14px; font-weight: 500; letter-spacing: .08em; }
.shard_wrap .shard_menu_panel { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; padding: 20px 22px 18px 36px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .35s var(--sh-glide), transform .35s var(--sh-glide), visibility 0s .35s; }
.shard_wrap .shard_menu.is-open .shard_menu_panel { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--sh-glide), transform .35s var(--sh-glide); }
.shard_wrap .shard_menu_head { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sh-dim); }
.shard_wrap .shard_menu_head + .shard_menu_list { margin-bottom: 16px; }
.shard_wrap .shard_menu_list { margin: 0; padding: 0; list-style: none; }
.shard_wrap .shard_menu_list a { display: flex; gap: 12px; padding: 5px 0; font-size: 15px; color: var(--sh-soft); transition: color .2s; }
.shard_wrap .shard_menu_list a:hover, .shard_wrap .shard_menu_list a.is-here { color: #fff; }
.shard_wrap .shard_menu_num { width: 26px; font-family: var(--sh-display); font-size: 14px; color: var(--sh-dim); }
.shard_wrap .shard_config { display: grid; gap: 2px; }
.shard_wrap .shard_config_row { display: flex; justify-content: space-between; width: 100%; padding: 5px 0; font-size: 15px; color: var(--sh-soft); text-align: left; }
.shard_wrap .shard_config_row:hover { color: #fff; }
.shard_wrap .shard_config_val { display: flex; gap: 10px; align-items: center; }
.shard_wrap .shard_config_val i { font-style: normal; font-size: 9px; color: var(--sh-dim); }
.shard_wrap .shard_config_val b { min-width: 46px; font-weight: 500; text-align: center; color: #fff; }
.shard_wrap .shard_gpu { margin: 8px 0 0; font-size: 11px; line-height: 1.45; color: var(--sh-dim); }

.shard_wrap .shard_status { position: absolute; z-index: 15; inset: auto 0 0; display: flex; align-items: flex-end; justify-content: space-between; padding: var(--sh-gutter); pointer-events: none; opacity: 0; transition: opacity 1.2s .8s; }
.shard_wrap.is-in .shard_status { opacity: 1; }
.shard_wrap .shard_maker { margin: 0; font-size: 12px; letter-spacing: .08em; color: var(--sh-dim); }
.shard_wrap .shard_timebox { min-width: 184px; padding: 10px 18px; font-size: 13.5px; }
.shard_wrap .shard_timebox p { display: flex; justify-content: space-between; gap: 18px; margin: 0; }
.shard_wrap .shard_timebox span { color: var(--sh-dim); }
.shard_wrap .shard_timebox b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- layers: one per memory ---- */
.shard_wrap .shard_layers { position: absolute; inset: 0; z-index: 5; pointer-events: none; text-shadow: 0 1px 28px rgba(8, 12, 36, .42); }
/* a finger drags sideways through the world (wind, roots, pyreflies) and still scrolls up and down */
.shard_wrap .shard_world { touch-action: pan-y pinch-zoom; }
.shard_wrap .shard_window { text-shadow: none; }
.shard_wrap .shard_layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
/* a soft night behind each memory's words, on their side of the screen; it comes and goes with them */
.shard_wrap .shard_layer::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(52% 70% at 74% 34%, rgba(10, 14, 40, .44), rgba(10, 14, 40, 0) 72%); }
.shard_wrap .is-lucis::before { background: radial-gradient(50% 72% at 20% 44%, rgba(10, 14, 40, .44), rgba(10, 14, 40, 0) 72%); }
.shard_wrap .is-memory::before { background: linear-gradient(0deg, rgba(10, 14, 40, .38), rgba(10, 14, 40, 0) 55%); }
.shard_wrap .is-roll::before { content: none; }
.shard_wrap .shard_layer.is-on button { pointer-events: auto; }
.shard_wrap .shard_layer > * { will-change: transform; }
.shard_wrap .shard_char { display: inline-block; will-change: opacity, transform; }
.shard_wrap .shard_word { display: inline-block; white-space: nowrap; }
.shard_wrap .shard_layer .is-late { opacity: 0; visibility: hidden; transition: opacity 1.2s var(--sh-glide), visibility 0s 1.2s; }
.shard_wrap .shard_layer.is-late-on .is-late { opacity: 1; visibility: visible; transition: opacity 1.2s var(--sh-glide); }
.shard_wrap .shard_layer.is-late-on .is-early { opacity: 0; visibility: hidden; transition: opacity .8s var(--sh-glide), visibility 0s .8s; }

/* I */
.shard_wrap .shard_hero { position: absolute; left: 50%; bottom: calc(18vh + 104px); width: min(92vw, 1180px); margin: 0; transform: translateX(-50%); text-align: center;
  font-family: var(--sh-display); font-weight: 400; font-size: clamp(40px, min(5.2vw, 9.6vh), 104px); line-height: 1.04; letter-spacing: .005em; }

/* a chapter opens like a location in the games: the game, then the place */
.shard_wrap .shard_chapter { position: absolute; left: 56vw; top: max(16vh, 108px); width: min(38vw, 560px); }
/* the game, as the series sets its own name: a crystal in the memory's light, the name carved, the
   year in a small window */
.shard_wrap .shard_chapter_game { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 16px; font-family: var(--sh-display); font-size: 15px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--sh-ink); }
.shard_wrap .shard_chapter_game::before { content: ''; flex: none; width: 9px; height: 20px; clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%); background: linear-gradient(160deg, #fff 10%, var(--sh-accent) 45%, color-mix(in srgb, var(--sh-accent) 40%, #10183d)); filter: drop-shadow(0 0 6px var(--sh-accent)); }
.shard_wrap .shard_chapter_year { padding: 3px 9px 4px; border-radius: 5px; font-family: var(--sh-sans); font-size: 11px; font-weight: 500; letter-spacing: .12em; background: linear-gradient(180deg, var(--sh-win-top), var(--sh-win-bot)); box-shadow: inset 0 0 0 1px var(--sh-win-line); }
.shard_wrap .shard_chapter_title { margin: 0; font-family: var(--sh-display); font-weight: 400; font-size: clamp(38px, min(4.2vw, 7.8vh), 76px); line-height: 1.04; letter-spacing: .005em; }
.shard_wrap .shard_line { position: absolute; left: 56vw; top: calc(max(16vh, 108px) + clamp(38px, min(4.2vw, 7.8vh), 76px) + 66px); width: min(34vw, 490px); margin: 0;
  font-family: var(--sh-serif); font-weight: 400; font-size: clamp(19px, 1.45vw, 23px); line-height: 1.45; color: var(--sh-soft); }
.shard_wrap .shard_line.is-step { opacity: 0; transform: translateY(10px); transition: opacity .9s var(--sh-glide), transform .9s var(--sh-glide); }
.shard_wrap .shard_line.is-step.is-shown { opacity: 1; transform: none; }
.shard_wrap .is-lucis .shard_chapter, .shard_wrap .is-lucis .shard_line { left: var(--sh-gutter); }
.shard_wrap .is-lucis .shard_line { width: min(30vw, 430px); }

/* commands: the series' selection, with the glove beside the one you're on */
.shard_wrap .shard_actions { position: absolute; left: 56vw; top: calc(max(16vh, 108px) + clamp(38px, min(4.2vw, 7.8vh), 76px) + 200px); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: min(34vw, 490px); }
.shard_wrap .is-world .shard_actions { top: calc(max(16vh, 108px) + clamp(38px, min(4.2vw, 7.8vh), 76px) + 168px); }
.shard_wrap .is-lucis .shard_actions { left: var(--sh-gutter); width: min(30vw, 430px); top: calc(max(16vh, 108px) + clamp(38px, min(4.2vw, 7.8vh), 76px) + 210px); }
.shard_wrap .shard_command { position: relative; overflow: hidden; padding: 13px 26px 14px; border-radius: 9px; font-size: 15px; font-weight: 500; letter-spacing: .04em; user-select: none; touch-action: none;
  background: linear-gradient(180deg, var(--sh-win-top), var(--sh-win-bot)); box-shadow: inset 0 0 0 1.5px var(--sh-win-line), inset 0 0 0 3px rgba(10, 14, 40, .6), 0 12px 30px -16px rgba(4, 8, 30, .8); transition: transform .3s var(--sh-glide), box-shadow .3s; }
.shard_wrap .shard_command:hover { transform: translateX(3px); box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 3px rgba(10, 14, 40, .6), 0 0 30px -8px var(--sh-accent); }
.shard_wrap .shard_command > span:last-child { position: relative; }
.shard_wrap .shard_command_fill { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 255, 255, .0), var(--sh-accent)); opacity: .5; transform: scaleX(0); transform-origin: left; }
.shard_wrap .shard_hint { margin: 0; font-size: 13.5px; letter-spacing: .02em; color: var(--sh-dim); }
.shard_wrap .shard_hint.is-sub { margin-top: -4px; font-size: 12.5px; }
.shard_wrap .shard_credit { margin: 2px 0 0; font-size: 11.5px; letter-spacing: .03em; color: var(--sh-dim); }
/* the FF gauge (the ATB bar): IX's trace to the source */
.shard_wrap .shard_gauge { display: flex; align-items: center; gap: 14px; padding: 10px 16px; font-size: 13px; letter-spacing: .06em; }
.shard_wrap .shard_atb_bar { position: relative; flex: 1; min-width: 150px; height: 8px; border-radius: 2px; background: rgba(4, 8, 30, .7); box-shadow: inset 0 0 0 1px rgba(236, 241, 255, .45); overflow: hidden; }
.shard_wrap .shard_atb_bar i { position: absolute; inset: 1px; border-radius: 1px; background: linear-gradient(90deg, #f1d48c, #fff6d0); transform: scaleX(0); transform-origin: left; }
.shard_wrap .shard_atb_bar.is-full i { animation: shard-atb .5s steps(2) infinite; }
@keyframes shard-atb { 50% { background: #fff; } }
/* XV: the Royal Arm obtained, and how many of the thirteen */
.shard_wrap .shard_obtained { min-width: 280px; padding: 12px 20px 14px; opacity: 0; transform: translateX(-14px); transition: opacity .5s, transform .5s var(--sh-glide); }
.shard_wrap .shard_obtained.is-on { opacity: 1; transform: none; }
.shard_wrap .shard_obtained_head { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sh-accent); }
.shard_wrap .shard_obtained_head b { font-weight: 500; color: var(--sh-ink); font-variant-numeric: tabular-nums; }
.shard_wrap .shard_obtained_name { margin: 0; font-family: var(--sh-display); font-size: 24px; line-height: 1.15; }
.shard_wrap .shard_statement { position: absolute; left: var(--sh-gutter); bottom: 15vh; margin: 0; font-family: var(--sh-display); font-weight: 400; letter-spacing: .02em;
  font-size: clamp(46px, min(6vw, 11vh), 120px); white-space: nowrap; }

/* V: the four crystals */
.shard_wrap .shard_choose { position: absolute; left: 56vw; top: calc(max(16vh, 108px) + clamp(38px, min(4.2vw, 7.8vh), 76px) + 176px); width: min(34vw, 490px); padding: 16px 20px 18px; }
.shard_wrap .shard_choose_head { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sh-dim); }
.shard_wrap .shard_crystals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.shard_wrap .shard_crystal { --c: #9ff2cf; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 10px 2px 8px; border-radius: 8px; transition: background .4s; }
.shard_wrap .shard_crystal:hover, .shard_wrap .shard_crystal.is-on { background: rgba(255, 255, 255, .07); }
.shard_wrap .shard_crystal.is-water { --c: #9ccfff; }
.shard_wrap .shard_crystal.is-fire { --c: #ffad7a; }
.shard_wrap .shard_crystal.is-earth { --c: #f1d48c; }
/* each gem is the series' crystal: a long six-sided shard, drawn in its element's light */
.shard_wrap .shard_crystal_gem { position: relative; width: 16px; height: 42px; clip-path: polygon(50% 0, 100% 30%, 100% 76%, 50% 100%, 0 76%, 0 30%);
  background: linear-gradient(115deg, rgba(255, 255, 255, .95) 0 18%, var(--c) 40%, color-mix(in srgb, var(--c) 45%, #0b1440) 62%, var(--c) 100%); opacity: .55;
  transition: opacity .4s, transform .5s var(--sh-glide), filter .4s; }
.shard_wrap .shard_crystal.is-on .shard_crystal_gem { opacity: 1; transform: translateY(-3px); filter: drop-shadow(0 0 8px var(--c)); }
.shard_wrap .shard_crystal_name { font-family: var(--sh-display); font-size: 17px; line-height: 1; letter-spacing: .03em; }
.shard_wrap .shard_crystal_of { font-size: 10.5px; letter-spacing: .02em; color: var(--sh-dim); white-space: nowrap; }
.shard_wrap .shard_choose_hint { margin: 0 0 12px; font-size: 13px; color: var(--sh-dim); }

/* the dialogue window: bottom of the screen, as in the games, typed out */
.shard_wrap .shard_dialogue { position: absolute; left: 50%; bottom: calc(var(--sh-gutter) + 84px); width: min(820px, calc(100vw - var(--sh-gutter) * 2)); margin: 0; padding: 20px 30px 22px; transform: translateX(-50%); }
.shard_wrap .shard_dialogue_name { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sh-accent); }
.shard_wrap .shard_dialogue_text { margin: 0; font-family: var(--sh-serif); font-weight: 500; font-size: clamp(19px, 1.5vw, 24px); line-height: 1.4; }
.shard_wrap .shard_dialogue_more { position: absolute; right: 18px; bottom: 12px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--sh-ink);
  animation: shard-more 1.1s steps(2) infinite; }
@keyframes shard-more { 50% { opacity: 0; } }
.shard_wrap .shard_dialogue.is-dark { --sh-win-top: rgba(40, 14, 30, .8); --sh-win-bot: rgba(8, 4, 12, .9); }
.shard_wrap .shard_dialogue.is-dark .shard_dialogue_name { color: #ff8fa6; }

/* ---- VII: the night after the Sending; the chrome steps away for Memoria ---- */
.shard_wrap.is-rolling .shard_top, .shard_wrap.is-rolling .shard_status { opacity: 0; pointer-events: none; transition: opacity 1s; }

/* ---- the load screen ---- */
.shard_wrap .shard_loader { position: absolute; inset: 0; z-index: 40; display: grid; grid-template-rows: 1fr auto auto 1fr; justify-items: center; gap: 26px; padding: 10vh var(--sh-gutter); text-align: center;
  background: linear-gradient(180deg, #02030c 0%, #060a22 45%, #101c48 82%, #1c2c66 100%); transition: opacity 1.6s var(--sh-glide), visibility 0s 1.6s; }
.shard_wrap .shard_loader.is-gone { opacity: 0; visibility: hidden; }
.shard_wrap .shard_loader_sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.shard_wrap .shard_loader_sky i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: shard-twinkle var(--d, 3s) ease-in-out var(--w, 0s) infinite alternate; }
@keyframes shard-twinkle { from { opacity: var(--o, .6); } to { opacity: .08; } }
.shard_wrap .shard_loader_head { align-self: end; position: relative; display: grid; justify-items: center; gap: 16px; }
.shard_wrap .shard_loader_mark { width: 40px; height: 64px; }
.shard_wrap .shard_loader_mark svg { width: 100%; height: 100%; overflow: visible; }
.shard_wrap .shard_loader_mark path { fill: none; stroke: var(--sh-ink); stroke-linejoin: miter; }
.shard_wrap .shard_loader_title { margin: 0; font-family: var(--sh-display); font-weight: 400; font-size: clamp(40px, min(5.4vw, 9vh), 92px); line-height: 1; letter-spacing: .16em; text-transform: uppercase; padding-left: .16em;
  background: linear-gradient(180deg, #ffffff 30%, #b9c7ee 70%, #8fa2d8); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 30px rgba(120, 150, 255, .35)); }
.shard_wrap .shard_loader_line { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--sh-dim); }
/* the save file */
.shard_wrap .shard_slot { position: relative; display: grid; gap: 10px; width: min(460px, 100%); padding: 18px 24px 20px; text-align: left; }
.shard_wrap .shard_slot_head { display: flex; justify-content: space-between; gap: 18px; margin: 0; font-size: 15px; }
.shard_wrap .shard_slot_head span:first-child { font-weight: 600; letter-spacing: .08em; }
.shard_wrap .shard_slot_head span:last-child { font-family: var(--sh-display); font-size: 17px; }
.shard_wrap .shard_slot_stats { display: flex; gap: 28px; font-size: 13px; }
.shard_wrap .shard_slot_stats p { display: flex; gap: 12px; margin: 0; }
.shard_wrap .shard_slot_stats span { color: var(--sh-dim); }
.shard_wrap .shard_slot_stats b { font-weight: 500; font-variant-numeric: tabular-nums; }
.shard_wrap .shard_atb { display: flex; align-items: center; gap: 14px; margin-top: 4px; font-size: 12.5px; letter-spacing: .08em; }
.shard_wrap .shard_atb_name { min-width: 64px; color: var(--sh-dim); }
.shard_wrap .shard_atb_num { min-width: 40px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.shard_wrap .shard_loader.is-done .shard_atb_name { color: #f1d48c; }
.shard_wrap .shard_loader_enter { position: relative; display: grid; gap: 2px; min-width: 240px; padding: 14px 26px 14px 48px; text-align: left; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .8s, transform .8s var(--sh-glide); align-self: start; }
.shard_wrap .shard_loader.is-done .shard_loader_enter { opacity: 1; transform: none; pointer-events: auto; }
.shard_wrap .shard_loader_btn { display: flex; justify-content: space-between; gap: 24px; padding: 6px 0; font-size: 17px; color: var(--sh-soft); text-align: left; }
.shard_wrap .shard_loader_btn:first-child { font-family: var(--sh-display); font-size: 21px; letter-spacing: .04em; color: #fff; }
.shard_wrap .shard_loader_btn.is-config { font-size: 14.5px; }
.shard_wrap .shard_loader_btn:hover, .shard_wrap .shard_loader_btn:focus-visible { color: #fff; }
.shard_wrap .shard_loader_credit { position: absolute; bottom: var(--sh-gutter); left: 0; right: 0; margin: 0; font-size: 11.5px; letter-spacing: .1em; color: var(--sh-dim); }

/* the glove */
.shard_wrap .shard_glove { position: fixed; z-index: 60; left: 0; top: 0; width: 30px; height: 18px; pointer-events: none; opacity: 0; transition: opacity .2s; filter: drop-shadow(0 2px 2px rgba(0, 0, 20, .5)); }
.shard_wrap .shard_glove path { fill: #fbfbff; stroke: #1b2448; stroke-width: 1.3; stroke-linejoin: round; }
.shard_wrap .shard_glove .shard_glove_line { fill: none; stroke-width: 1; }
.shard_wrap .shard_glove.is-on { opacity: 1; animation: shard-point .7s ease-in-out infinite alternate; }
.shard_wrap .shard_glove.is-free { animation: none; }
@keyframes shard-point { from { translate: -3px 0; } to { translate: 1px 0; } }
@media (hover: none) { .shard_wrap .shard_glove { display: none; } }

/* ---- portrait: phones and upright tablets. The subject sits up top; the words gather below ---- */
@media (max-aspect-ratio: 19/20) {
  .shard_wrap .shard_brand_word { font-size: 13px; letter-spacing: .2em; }
  .shard_wrap .shard_menu_btn { padding: 9px 18px 10px; font-size: 13px; }
  .shard_wrap .shard_menu_panel { width: min(320px, calc(100vw - var(--sh-gutter) * 2)); }
  .shard_wrap .shard_hero { bottom: calc(var(--sh-gutter) + 210px); font-size: clamp(36px, 10vw, 70px); }
  .shard_wrap .shard_chapter, .shard_wrap .is-lucis .shard_chapter { left: var(--sh-gutter); right: var(--sh-gutter); top: auto; bottom: calc(var(--sh-gutter) + 64px + var(--below, 300px)); width: auto; }
  .shard_wrap .shard_chapter_title { font-size: clamp(32px, 8.6vw, 56px); }
  .shard_wrap .shard_line, .shard_wrap .is-lucis .shard_line { left: var(--sh-gutter); right: var(--sh-gutter); top: auto; bottom: calc(var(--sh-gutter) + 64px + var(--below, 300px) - var(--line, 0px)); width: auto; font-size: 17px; }
  .shard_wrap .shard_dialogue { bottom: calc(var(--sh-gutter) + 54px); padding: 14px 18px 16px; }
  .shard_wrap .shard_dialogue_text { font-size: 17px; }
  .shard_wrap .shard_timebox { min-width: 0; padding: 7px 12px; font-size: 11px; }
  .shard_wrap .shard_timebox p { gap: 10px; }
  .shard_wrap .is-wind { --below: 300px; --line: 0px; }
  .shard_wrap .is-wind .shard_line { display: none; }
  .shard_wrap .shard_choose { left: var(--sh-gutter); right: var(--sh-gutter); top: auto; bottom: calc(var(--sh-gutter) + 54px); width: auto; padding: 12px 14px 14px; }
  .shard_wrap .shard_crystal_of { display: none; }
  .shard_wrap .shard_crystal_gem { width: 13px; height: 34px; }
  .shard_wrap .is-magi { --below: 330px; --line: 86px; }
  .shard_wrap .is-world { --below: 270px; --line: 86px; }
  .shard_wrap .is-lucis { --below: 300px; --line: 110px; }
  .shard_wrap .is-farplane { --below: 210px; --line: 110px; }
  .shard_wrap .shard_actions, .shard_wrap .is-lucis .shard_actions, .shard_wrap .is-world .shard_actions { left: var(--sh-gutter); right: var(--sh-gutter); top: auto; bottom: calc(var(--sh-gutter) + 54px + var(--dialogue, 120px)); width: auto; align-items: flex-start; text-align: left; gap: 10px; }
  .shard_wrap .is-farplane .shard_actions { --dialogue: 0px; }
  .shard_wrap .shard_statement { left: 50%; transform: translateX(-50%); bottom: calc(var(--sh-gutter) + 230px); font-size: clamp(44px, 12vw, 90px); }
  .shard_wrap .shard_obtained { min-width: 0; }
  .shard_wrap .shard_layer::before { content: none; }
  /* the words sit low over pale skies: a night rises behind them */
  .shard_wrap .shard_layers::before { content: ''; position: absolute; inset: 42% 0 0; background: linear-gradient(0deg, rgba(8, 12, 36, .6), rgba(8, 12, 36, 0)); }
}
@media (max-aspect-ratio: 19/20) {
  .shard_wrap .shard_layer.is-late-on .shard_chapter, .shard_wrap .shard_layer.is-late-on .shard_line, .shard_wrap .shard_layer.is-late-on .shard_actions { opacity: 0; visibility: hidden; transition: opacity .8s, visibility 0s .8s; }
}
/* short wide screens: XV's closing line takes the place of its controls */
@media (min-aspect-ratio: 19/20) and (max-height: 860px) {
  .shard_wrap .is-lucis.is-late-on .shard_actions { opacity: 0; visibility: hidden; transition: opacity .8s, visibility 0s .8s; }
}
@media (max-aspect-ratio: 19/20) and (max-width: 520px) {
  .shard_wrap .shard_maker { display: none; }
  .shard_wrap .is-magi .shard_credit, .shard_wrap .is-magi .shard_hint.is-sub { display: none; }
  .shard_wrap .is-magi { --below: 300px; }
  .shard_wrap .shard_slot_stats { gap: 16px; }
}

/* keyboard: a gold ring on whatever has focus */
.shard_wrap :focus-visible { outline: 2px solid #e7c98e; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .shard_wrap *, .shard_wrap *::before, .shard_wrap *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
}
