/* Stars of arcane dust: the shared look of the world chooser's sky and the World front page's star chart.
   A star is <a class="star"> holding .halo, .ring, .dust (paths from chooser-core.js dustCluster), .em, .hit and
   .lbl; lines are .th/.gl/.pu groups of paths. --lx/--ly place a star; --o and --i stagger the animations.
   The page's <svg> needs the radialGradient #halo. Colours come from tidewater.css. */

.halo-stop { stop-color: var(--accent); }
.halo-stop-0 { stop-opacity: .2; }
.halo-stop-1 { stop-opacity: .06; }
.halo-stop-2 { stop-opacity: 0; }
.sk circle { fill: var(--title); opacity: .35; animation: appear 1.4s ease .3s both; }
.sk circle:nth-child(3n) { fill: var(--accent); opacity: .3; }
.sk circle:nth-child(4n+1) { animation: appear 1.4s ease .3s both, twinkle 9s ease-in-out calc(var(--i, 0) * 1s + 4s) infinite; }
@keyframes appear { from { opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: .12; } }

/* Lines between worlds: one set for landscape screens, one for portrait. */
.th path, .gl path, .pu path { fill: none; stroke-linecap: round; }
.th path { stroke: var(--accent); stroke-width: 1.4; stroke-opacity: .45; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 2.2s cubic-bezier(.4, 0, .2, 1) calc(var(--i, 0) * .5s + 2.6s) both; }
.gl path { stroke: var(--accent); stroke-width: 6; stroke-opacity: .08; stroke-dasharray: 1; animation: draw 2.2s cubic-bezier(.4, 0, .2, 1) calc(var(--i, 0) * .5s + 2.6s) both; }
.pu path { stroke: var(--accent-bright); stroke-width: 2.2; stroke-dasharray: .08 .92; stroke-dashoffset: 1; opacity: 0; animation: pulse 11s linear calc(var(--i, 0) * 2.3s + 7s) infinite; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { stroke-dashoffset: 1; opacity: 0; } 4% { opacity: .9; } 40% { opacity: .9; } 44% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
/* World stars. --lx/--ly and --px/--py are the landscape and portrait positions, set per star. */
.star { transform: translate(var(--lx), var(--ly)); cursor: pointer; }
.star:hover { text-decoration: none; }
.halo { fill: url(#halo); animation: appear 2s ease calc(var(--o, 0) * .4s + .6s) both, breathe 8s ease-in-out calc(var(--o, 0) * 1.3s + 4s) infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
.ring { fill: none; stroke: var(--accent); stroke-opacity: .3; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 2.4s cubic-bezier(.4, 0, .2, 1) calc(var(--o, 0) * .4s + 1s) both; transform-box: fill-box; transform-origin: center; transition: transform .2s ease, stroke-opacity .2s ease; }
.ring.dashed { stroke-dasharray: .03 .025; stroke-opacity: .5; animation: none; }
.star:hover .ring, .star.on .ring { stroke-opacity: .7; transform: scale(1.06); }
.dust path { fill: none; stroke: var(--accent); stroke-linecap: round; animation: gather 2.4s cubic-bezier(.2, .6, .2, 1) calc(var(--o, 0) * .4s + var(--k, 0) * .12s + .2s) both, shimmer 8s ease-in-out calc(var(--o, 0) * .7s + var(--k, 0) * .9s + 4s) infinite; }
.dust .s0 { stroke-width: 2; stroke-opacity: .55; }
.dust .s1 { stroke-width: 2.8; stroke-opacity: .8; }
.dust .s2 { stroke-width: 4; stroke: var(--accent-bright); stroke-opacity: .95; }
.dust path:nth-child(8n+1) { --k: 0; } .dust path:nth-child(8n+2) { --k: 1; } .dust path:nth-child(8n+3) { --k: 2; } .dust path:nth-child(8n+4) { --k: 3; }
.dust path:nth-child(8n+5) { --k: 4; } .dust path:nth-child(8n+6) { --k: 5; } .dust path:nth-child(8n+7) { --k: 6; } .dust path:nth-child(8n) { --k: 7; }
@keyframes gather { from { opacity: 0; transform: translate(calc(sin(var(--k, 0) * .785 + var(--o, 0)) * 70px), calc(cos(var(--k, 0) * .785 + var(--o, 0)) * 70px)) scale(1.4); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.em path { fill: none; stroke: var(--accent-bright); stroke-width: 1; stroke-opacity: .55; stroke-dasharray: 1; }
.em { animation: appear 1.6s ease calc(var(--o, 0) * .4s + 2.4s) both; }
.em circle { fill: var(--accent-bright); opacity: .9; }
.hit { fill: transparent; }
.lbl { fill: var(--text-muted); font-size: 15px; text-anchor: middle; font-family: var(--font-serif); transition: fill .2s ease; animation: appear 1.2s ease calc(var(--o, 0) * .4s + 1.8s) both; }
.star:hover .lbl, .star.on .lbl { fill: var(--title); }
/* The ring is the focus mark; the browser's box outline would cut across the sky. */
.star:focus, .star:focus-visible { outline: none; }
.star:focus-visible .ring { stroke-opacity: .9; stroke-width: 2; }
