/* The sign-in island beside the card: sky, land, office, robots */
:root {
    --lamp: #FFD36B;
    /* Night: a navy model under the moon */
    --ground: #2D3577; --sand: #3B4385; --lawn: #1F514C; --pad: #252C66; --road: #1D2459; --kerb: #414A93;
    --earth-l: #151A46; --earth-r: #0F1338; --soil: #181D4C; --sand-side: #2A3069; --sea: #1C2C80; --sea-l: #17246C; --sea-r: #121B57;
    --b1t: #2F387C; --b1l: #202864; --b1r: #171D4F;
    --b2t: #343E86; --b2l: #252D6C; --b2r: #1B2257;
    --b3t: #2A3274; --b3l: #1C235B; --b3r: #141A48;
    --mt: #3C4694; --ml: #2C357C; --mr: #202863;
    --glass: #141A47; --frame: rgb(0 0 0 / .22); --door: #0E1236; --edge: #39428A;
    --tent: #414A86; --tent-side: #2D3466; --dome: #1F7A6C; --band: #4B55A6;
    --trunk: #4B3B33; --leaf: #24543F; --post: #3B4484; --wire: #39428A;
    --cast: rgb(0 0 0 / .16); --plate-shadow: rgb(0 0 0 / .3);
    --cloth: #12173F; --stitch-a: #E8C766; --stitch-b: #E0526A;
}
body.is-day {
    --ground: #EFE8DA; --sand: #F2E0B6; --lawn: #B9DBA0; --pad: #D9DCE1; --road: #8E96A5; --kerb: #F8FAFC;
    --earth-l: #A88F69; --earth-r: #8E7651; --soil: #B89F78; --sand-side: #D9C28F; --sea: #55BBDF; --sea-l: #49AAD2; --sea-r: #3690BD;
    --b1t: #FBF4E6; --b1l: #EFE3CB; --b1r: #DBC9A8;
    --b2t: #F8EDD8; --b2l: #E8D8B9; --b2r: #D1BD97;
    --b3t: #F2EFE9; --b3l: #E3DFD7; --b3r: #CAC5BA;
    --mt: #FFFFFF; --ml: #F6F3EC; --mr: #DFDBD0;
    --glass: #8EA7C2; --frame: #F8FAFC; --door: #5B4636; --edge: #C9B48F;
    --tent: #F4EEE0; --tent-side: #D9D0BC; --dome: #3FA98A; --band: #C9B48F;
    --trunk: #8B6A4C; --leaf: #3F8F5F; --post: #64748B; --wire: #8A96AA;
    --cast: rgb(60 50 20 / .1); --plate-shadow: rgb(30 42 120 / .14);
    --cloth: #F7EEDA; --stitch-a: #B4232C; --stitch-b: #1F2937;
}

/* ── Sky ── */
.auth-sky { position: fixed; inset: -10px; background: radial-gradient(900px 420px at 22% 18%, #26308A 0%, transparent 70%), linear-gradient(#060A24, #0D1340 55%, #151C55); will-change: transform; }
body.is-day .auth-sky { background: radial-gradient(420px 260px at 20% 18%, rgb(255 240 190 / .45) 0%, transparent 70%), linear-gradient(#6DB7F2, #A9D6FA 42%, #DDEFFC 72%, #F6EBDA); }
/* Darker corners pull the eye to the model */
.auth-sky::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 42% 52%, transparent 55%, rgb(3 6 26 / .5)); }
body.is-day .auth-sky::after { background: radial-gradient(ellipse 75% 70% at 42% 52%, transparent 55%, rgb(46 110 190 / .2)); }
#sceneStars { position: absolute; inset: 0; width: 100%; height: 100%; }
.star { fill: #fff; }
.star.tw1 { animation: twinkle 2.3s steps(1) infinite; }
.star.tw2 { animation: twinkle 3.1s steps(1) -1s infinite; }
.star.tw3 { animation: twinkle 1.7s steps(1) -.6s infinite; }
body.is-day .star { display: none; }
.moon { fill: #E9ECFF; pointer-events: auto; cursor: pointer; }
.moon-marks circle { fill: #C3CBF2; opacity: .55; }
#moonGlow stop { stop-color: #C7D2FE; }
body.is-day .moon { fill: url(#sunFill); stroke: #FFF1BF; stroke-width: 2.5; stroke-opacity: .75; }
body.is-day .moon-marks { display: none; }
body.is-day #moonGlow stop { stop-color: #FFD27A; }
/* The sun: tapered rays that turn, a corona that breathes, a shine */
.sun-rays, .sun-corona, .sun-shine { display: none; }
.sun-rays { fill: #FFC93C; stroke: #FFC93C; stroke-width: 1.6; stroke-linejoin: round; opacity: .92; }
.sun-corona { fill: url(#sunCorona); }
.sun-shine { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: .55; }
body.is-day .sun-rays { display: inline; animation: sun-turn 80s linear infinite; }
body.is-day .sun-corona { display: inline; animation: sun-breathe 4.5s ease-in-out infinite alternate; }
body.is-day .sun-shine { display: inline; }
body.is-lite .sun-rays, body.is-lite .sun-corona { animation: none; }
/* Two day clouds, drawn with the island, sway in place */
.cloud { display: none; fill: #fff; opacity: .85; }
body.is-day .cloud { display: inline; animation: cloud-sway 70s ease-in-out infinite alternate; }
.cloud.low { opacity: .7; animation-duration: 95s; animation-delay: -30s; }
body.is-lite .cloud { animation: none; }

/* ── The stage: two stacked drawings of one island ── */
.auth-stage svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* Still land on its own layer; robots never repaint it */
#sceneLand { will-change: transform; }
.home, .bot, .gen, .fisher { pointer-events: auto; cursor: pointer; }

/* The model assembles: plate, far pieces first, then the team */
@media (prefers-reduced-motion: no-preference) {
    .is-building .plate { animation: plate-in .7s cubic-bezier(.2, .8, .3, 1) backwards; }
    .is-building .rise { transform-box: fill-box; transform-origin: 50% 100%; animation: rise .65s cubic-bezier(.2, 1.3, .35, 1) backwards; animation-delay: calc(.35s + var(--i) * 28ms); }
    .is-building .shades, .is-building .wires, .is-building .traffic { animation: fade-in .6s ease-out 1.3s backwards; }
    .is-building #sceneCrew { animation: crew-in .6s ease-out 1.2s backwards; }
    .is-building #sceneSun { animation: fade-in .9s ease-out .2s backwards; }
    /* Weak devices get one soft move for the whole model */
    .is-lite:not(.is-building) .auth-stage { animation: crew-in .7s ease-out backwards; }
}

/* The plate and its ground */
.plate-shadow { fill: var(--plate-shadow); }
.earth.left { fill: var(--earth-l); }
.earth.right { fill: var(--earth-r); }
.soil { fill: var(--soil); }
.sand-side { fill: var(--sand-side); }
.sea-side.left { fill: var(--sea-l); }
.sea-side.right { fill: var(--sea-r); }
/* The embroidered ribbon around the base */
.ribbon { fill: var(--cloth); }
.stitch.a { fill: var(--stitch-a); }
.stitch.b { fill: var(--stitch-b); }
/* Light glitters on the water */
.glint { fill: #C7D2FE; opacity: .5; }
.glint.a { animation: glint 2.6s steps(1) infinite; }
.glint.b { animation: glint 2.6s steps(1) -1.3s infinite; }
body.is-day .glint { fill: #fff; opacity: .9; }
body.is-lite .glint { animation: none; }
.ground { fill: var(--ground); }
.sand { fill: var(--sand); }
.lawn { fill: var(--lawn); }
.pad { fill: var(--pad); }
.pad-line { fill: none; stroke: #FACC15; stroke-width: 2; stroke-dasharray: 9 7; opacity: .75; }
.road { fill: var(--road); }
.kerb { fill: var(--kerb); }
.lane { fill: none; stroke: rgb(255 255 255 / .34); stroke-width: 2; stroke-dasharray: 12 10; }
.zebra { fill: rgb(255 255 255 / .72); }
.manhole { fill: rgb(0 0 0 / .26); }
.sea { fill: var(--sea); }
.foam { fill: none; stroke: #fff; stroke-width: 3; opacity: .45; }
.wave { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; opacity: .3; }
.cast { fill: var(--cast); }
.ground-shade { fill: rgb(0 0 0 / .14); }
body.is-day .lane { stroke: rgb(255 255 255 / .85); }
body.is-day .zebra { fill: rgb(255 255 255 / .92); }
body.is-day .foam { opacity: .85; }
body.is-day .wave { opacity: .6; }

/* Faces take one colour for fill and seam */
.wall, .balcony, .crate, .jerrycan, .bench, .tank-foot, .desk, .pot, .cooler, .office-stub, .gen-body, .gen-skid, .gen-exhaust { fill: currentColor; stroke: currentColor; stroke-width: .7; stroke-linejoin: round; }
.wall.b1.top { color: var(--b1t); } .wall.b1.left { color: var(--b1l); } .wall.b1.right { color: var(--b1r); }
.wall.b2.top { color: var(--b2t); } .wall.b2.left { color: var(--b2l); } .wall.b2.right { color: var(--b2r); }
.wall.b3.top { color: var(--b3t); } .wall.b3.left { color: var(--b3l); } .wall.b3.right { color: var(--b3r); }
.wall.mosque.top { color: var(--mt); } .wall.mosque.left { color: var(--ml); } .wall.mosque.right { color: var(--mr); }
.home:hover .wall.left { filter: brightness(1.08); }
.roof { fill: rgb(0 0 0 / .1); }
/* Walls darken toward the ground; lit homes glow on theirs */
.face-shade { fill: url(#faceShade); pointer-events: none; }
body.is-day .face-shade { opacity: .55; }
.halo { fill: url(#haloFill); opacity: 0; transition: opacity .7s; pointer-events: none; }
.home.lit .halo { opacity: 1; }
body.is-day .halo { display: none; }
.floor-line { fill: rgb(0 0 0 / .1); }
.win-frame { fill: var(--frame); }
.win { fill: var(--glass); transition: fill .35s; }
.win.on { fill: var(--lamp); }
.win.on.t2 { fill: #FFE6AE; }
.win.on.t3 { fill: #FFC56B; }
/* By day lit windows are a stronger amber */
body.is-day .win.on { fill: #FFC233; }
body.is-day .win.on.t2 { fill: #FFD25C; }
body.is-day .win.on.t3 { fill: #FFAE1F; }
.door { fill: var(--door); }
.ac { fill: #CBD5E1; stroke: #94A3B8; stroke-width: .6; }
.balcony.top { color: var(--b3t); } .balcony.left { color: var(--edge); } .balcony.right { color: var(--edge); }
.rail { fill: none; stroke: var(--edge); stroke-width: 1; }
.shop-sign.s0, .awning.s0 { fill: #0F766E; }
.shop-sign.s1, .awning.s1 { fill: #B91C1C; }
.shop-sign.s2, .awning.s2 { fill: #1D4ED8; }
.awning.alt { fill: #F1F5F9; }
/* Shutters roll up when the power reaches the shop */
.shutter { fill: #3B4380; stroke: #2B3478; stroke-width: .7; transform-box: fill-box; transform-origin: 50% 0; transition: transform .7s cubic-bezier(.3, .8, .3, 1); }
body.is-day .shutter { fill: #A9B1BE; stroke: #8B93A3; }
.home.lit .shutter { transform: scaleY(.18); }
/* Roof tanks and camp barrels: ribs, a shine, a lid */
.barrel { fill: #1D4ED8; } .barrel-top { fill: #60A5FA; }
.barrel.is-black { fill: #232A5C; } .barrel-top.is-black { fill: #3A4486; }
body.is-day .barrel.is-black { fill: #1F2937; } body.is-day .barrel-top.is-black { fill: #4B5563; }
.barrel.is-rust { fill: #C2410C; } .barrel-top.is-rust { fill: #FB923C; }
.barrel-rib { fill: none; stroke: rgb(255 255 255 / .3); stroke-width: 1; }
.barrel-shine { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; opacity: .28; }
.barrel-lid { fill: rgb(15 23 42 / .4); }
.tank-leg { fill: none; stroke: #64748B; stroke-width: 1.8; stroke-linecap: round; }
/* Solar panels lean on their frames and catch the light */
.solar { fill: #1D4ED8; stroke: #E2E8F0; stroke-width: 1.2; }
body.is-day .solar { fill: #2563EB; }
.solar-grid { fill: none; stroke: #BFDBFE; stroke-width: .7; opacity: .85; }
.solar-glint { fill: #fff; opacity: .22; }
.solar-leg { fill: none; stroke: #94A3B8; stroke-width: 1.4; stroke-linecap: round; }
.dish { fill: none; stroke: #94A3B8; stroke-width: 1.6; stroke-linecap: round; }
.mosque-band { fill: var(--band); opacity: .7; }
.dome-drum { fill: var(--ml); }
.dome { fill: var(--dome); }
.dome-light { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .28; }
.crescent { fill: #E8C766; stroke: #E8C766; stroke-width: 1.4; stroke-linecap: round; }
/* The camp and the market */
.tent { fill: var(--tent); }
.tent-side { fill: var(--tent-side); }
.tarp { fill: #2563EB; opacity: .85; }
.tent-seam { fill: none; stroke: rgb(0 0 0 / .16); stroke-width: .8; }
.rope { fill: none; stroke: #7C86B8; stroke-width: .9; }
body.is-day .rope { stroke: #94A3B8; }
.stone { fill: #9CA3AF; }
.jerrycan.top { color: #60A5FA; } .jerrycan.left { color: #2563EB; } .jerrycan.right { color: #1D4ED8; }
.jerrycan.alt.top { color: #FDE047; } .jerrycan.alt.left { color: #EAB308; } .jerrycan.alt.right { color: #CA8A04; }
.crate.top { color: #B98A4E; } .crate.left { color: #A1743C; } .crate.right { color: #86602F; }
.bench.top { color: #B98A4E; } .bench.left { color: #A1743C; } .bench.right { color: #86602F; }
.palm-trunk { fill: none; stroke: var(--trunk); stroke-width: 4.5; stroke-linecap: round; }
.palm-leaf { fill: none; stroke: var(--leaf); stroke-width: 3.2; stroke-linecap: round; }
/* Poles, wires and street lamps */
.pole { fill: var(--post); }
.pole-bar { fill: none; stroke: var(--post); stroke-width: 2.6; stroke-linecap: round; }
.wire { fill: none; stroke: var(--wire); stroke-width: 1.1; transition: stroke .4s; }
.wire.on { stroke: #D9B152; }
.lamp-post { fill: none; stroke: var(--post); stroke-width: 2.4; stroke-linecap: round; }
.lamp-head { fill: #3B4380; }
body.is-day .lamp-head { fill: #94A3B8; }
.cone, .pool { opacity: 0; transition: opacity .6s; pointer-events: none; }
.cone { fill: url(#coneFill); }
.pool { fill: url(#poolFill); }
.pool.on, .auth-stage.on .cone, .auth-stage.on .lamp-pool { opacity: 1; }
.auth-stage.on .lamp-head { fill: #FFE7A3; }
body.is-day .cone, body.is-day .pool { display: none; }
.tank-foot.top { color: #64748B; } .tank-foot.left { color: #475569; } .tank-foot.right { color: #334155; }
.fuel { fill: #B91C1C; }
.fuel.drum-body { fill: none; stroke: #DC2626; stroke-linecap: butt; }
.fuel.end { fill: #EF4444; stroke: #FCA5A5; stroke-width: 1; }

/* ── Generator ── */
.gen-body.top { color: #4A60D0; } .gen-body.left { color: #3349B4; } .gen-body.right { color: #253792; }
.gen-skid.top { color: #1E293B; } .gen-skid.left { color: #0F172A; } .gen-skid.right { color: #0B1120; }
.gen-exhaust.top { color: #64748B; } .gen-exhaust.left { color: #475569; } .gen-exhaust.right { color: #334155; }
.gen-lid { fill: rgb(255 255 255 / .12); }
.gen-stripe { fill: #FACC15; }
.gen-vent { fill: none; stroke: rgb(8 12 40 / .5); stroke-width: 2.4; stroke-linecap: round; }
.gen-door { fill: rgb(8 12 40 / .14); stroke: rgb(255 255 255 / .28); stroke-width: .8; }
.gen-handle { stroke: #E2E8F0; stroke-width: 1.6; stroke-linecap: round; }
.gen-panel { fill: #0F172A; stroke: rgb(255 255 255 / .18); stroke-width: .8; }
.gen-socket { fill: #0F172A; stroke: #F59E0B; stroke-width: 1.2; }
.gen-mast { fill: none; stroke: #94A3B8; stroke-width: 2; stroke-linecap: round; }
.gen:hover .gen-body.left { color: #3D55C6; }
.gauge { fill: #F8FAFC; stroke: #94A3B8; stroke-width: 1.2; }
.needle { fill: none; stroke: #DC2626; stroke-width: 1.6; stroke-linecap: round; }
.needle-run, .gen.run .needle-rest { display: none; }
.gen.run .needle-run { display: inline; }
.gen-btn { fill: #DC2626; }
.gen.run .gen-shake { animation: rumble .14s linear infinite; }
.gen.rev .gen-shake { animation: rumble-hard .06s linear infinite; }
.gen-lamp { fill: #3B4380; }
.gen-lamp.on { fill: #4ADE80; }
body.is-cut .gen-lamp { fill: #EF4444; }
body.is-repair .gen-lamp { fill: #F59E0B; animation: lamp-blink 1.2s steps(2) infinite; }
.smoke { fill: #9AA3D8; opacity: 0; transform-box: fill-box; transform-origin: center; }
body.is-day .smoke { fill: #94A3B8; }
.run .smoke { animation: puff 3s ease-out infinite; }
.run .smoke:nth-child(2) { animation-delay: 1s; }
.run .smoke:nth-child(3) { animation-delay: 2s; }
.gen.rev .smoke { animation-duration: .9s; }
.spark { fill: #FFF3B0; }
.shooting { opacity: 0; }
body.is-day .shooting, body.is-day .beam { display: none; }
.burst { fill: none; stroke: #FFF3B0; stroke-width: 1.6; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; animation: burst 2.4s linear infinite; }
body.is-day .burst { stroke: #F59E0B; }
.eyes ellipse { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.done-pop { opacity: 0; animation: done-pop 6s infinite; }
body.is-lite .burst, body.is-lite .done-pop { display: none; }
body.is-lite .eyes ellipse, body.is-lite .gen.run .gen-shake, body.is-lite .mini-dot.warn { animation: none; }

/* ── The office: always working; a power cut dims it ── */
.office-floor { fill: #E9D6AC; }
.floor-tiles { fill: none; stroke: rgb(120 90 30 / .16); stroke-width: 1; }
.rug { fill: #3445B4; opacity: .88; }
.office-wall.left { fill: #FBEFCB; }
.office-wall.right { fill: #EBDCB4; }
.office-top { fill: #475569; }
.office-end.left { fill: #334155; }
.office-end.right { fill: #1E293B; }
.office-stub.top { color: #64748B; } .office-stub.left { color: #475569; } .office-stub.right { color: #334155; }
.office-pane { fill: rgb(200 225 255 / .1); }
body.is-day .office-pane { fill: rgb(255 255 255 / .2); }
.office-beam { fill: none; stroke: #475569; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.office-glass { fill: #1B2A7A; }
body.is-day .office-glass { fill: #BFE3F7; }
.office-frame { fill: none; stroke: #fff; stroke-width: 1.8; }
.shelf { fill: none; stroke: #8B6A4C; stroke-width: 2.4; stroke-linecap: round; }
.logo-disc { fill: #fff; stroke: #E2E8F0; stroke-width: 1; }
.door-mat { fill: #7C2D12; opacity: .55; }
.clock-face { fill: #F8FAFC; stroke: #94A3B8; stroke-width: 1.5; }
.clock-hand { stroke: #1E293B; stroke-width: 1.8; stroke-linecap: round; }
.wall-screen { fill: #0F172A; stroke: #334155; stroke-width: 2; }
.chart-bar { fill: #38BDF8; opacity: .85; }
.chart-line { fill: none; stroke: #22C55E; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; }
.mini-gen { fill: #1E3A8A; stroke: #64748B; stroke-width: 1; }
.mini-dot.ok { fill: #22C55E; }
.mini-dot.warn { fill: #F59E0B; animation: warn-blink 1.2s infinite; }
.board { fill: #F8FAFC; stroke: #94A3B8; stroke-width: .8; }
.board-lines { fill: none; stroke: #CBD5E1; stroke-width: .8; }
.note.n1 { fill: #FDE68A; }
.note.n2 { fill: #FBCFE8; }
.note.n3 { fill: #BBF7D0; }
.desk.top { color: #C89B63; } .desk.left { color: #A87C48; } .desk.right { color: #8C6538; }
/* Each desk: a keyboard and a see-through glass screen */
.keyboard { fill: #E2E8F0; stroke: #94A3B8; stroke-width: .5; }
.glass-stand { fill: none; stroke: #94A3B8; stroke-width: 2.2; stroke-linecap: round; }
.glass-screen { fill: rgb(125 249 255 / .24); stroke: rgb(255 255 255 / .8); stroke-width: 1; }
.glass-ink { fill: none; stroke: #ECFEFF; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
body.is-day .glass-screen { fill: rgb(56 189 248 / .3); stroke: rgb(255 255 255 / .95); }
.pot.top { color: #B45309; } .pot.left { color: #92400E; } .pot.right { color: #78350F; }
.leaf { fill: #15803D; }
.cooler.top { color: #F8FAFC; } .cooler.left { color: #E2E8F0; } .cooler.right { color: #CBD5E1; }
.cooler-bottle { fill: #7DD3FC; opacity: .9; }
.office-dim { fill: #0B1033; opacity: 0; transition: opacity .6s; pointer-events: none; }
body.is-cut .office-dim { opacity: .55; }
/* The lightbox sign wakes with the power */
.sign-leg { fill: none; stroke: #475569; stroke-width: 2.4; }
.sign-plate { fill: #1E293B; stroke: rgb(255 255 255 / .3); stroke-width: 1; }
.sign-plate.on { fill: #FFF6D2; }
.sign-text { fill: #CBD5E1; font-family: 'Tajawal', sans-serif; font-size: 11px; font-weight: 700; transition: fill .35s; }
.sign-plate.on ~ .sign-text { fill: #1E293B; }
.sign-bolt { fill: #FFD36B; }
.sign-plate.on ~ .sign-bolt { fill: #F59E0B; }

/* The beach */
.parasol { fill: #EF4444; }
.parasol.alt { fill: #F8FAFC; }
.parasol-pole { fill: none; stroke: #94A3B8; stroke-width: 1.8; stroke-linecap: round; }
.towel { fill: #38BDF8; }
.boat { fill: #F8FAFC; }
.boat-rim { fill: #2563EB; }
.boat-lantern { fill: #FFD36B; }
.ripple { fill: rgb(255 255 255 / .16); }
.rod { fill: none; stroke: #7C5E44; stroke-width: 1.6; stroke-linecap: round; }
.fish-line { fill: none; stroke: rgb(255 255 255 / .65); stroke-width: .7; }
.float { fill: #EF4444; }
/* Palestine's flag: a pole, and slices that ripple in turn */
.flag-pole { stroke: #CBD5E1; stroke-width: 2.2; stroke-linecap: round; }
.flag-knob { fill: #FFD36B; }
.flag-slice { filter: drop-shadow(0 1px 1px rgb(0 0 0 / .18)); }
@media (prefers-reduced-motion: no-preference) {
    .flag-slice { animation: flag-wave 1.6s ease-in-out infinite; }
}
@keyframes flag-wave { 0%, 100% { transform: translateY(calc(var(--lift) * -1)); } 50% { transform: translateY(var(--lift)); } }
/* The fishing game: the float dips, a caught fish jumps */
.float-dip { transition: transform .15s; }
.fisher.bite .float-dip { transform: translateY(7px); }
.fisher-hit { fill: transparent; }
/* A bite rings the water around the boat, lite or not. */
.ripple { transform-box: fill-box; transform-origin: center; }
.fisher.bite .ripple { animation: bite-ring .6s ease-out infinite; }
@keyframes bite-ring { 50% { transform: scale(1.35); fill: rgb(255 255 255 / .45); } }
.fish { fill: #F59E0B; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fisher.caught .fish { animation: fish-jump .9s ease-out; }

/* The police car: a small robot patrol on the two roads. */
.car-shade { fill: rgb(15 23 42 / .2); }
.car-body.top { fill: #FFFFFF; } .car-body.left { fill: #F1F5F9; } .car-body.right { fill: #DCE3EE; }
.car-cab.top { fill: #2D46B9; } .car-cab.left { fill: #1E3A8A; } .car-cab.right { fill: #172E6E; }
.car-bar.top { fill: #E2E8F0; } .car-bar.left { fill: #94A3B8; } .car-bar.right { fill: #64748B; }
.car-band { fill: #1D4ED8; }
.car-wheel { fill: #1F2937; } .car-hub { fill: #94A3B8; }
.car-badge { fill: #FACC15; stroke: #92400E; stroke-width: .6; }
.car-lamp { fill: #FFF3B0; }
.car-glass { fill: #BFDBFE; }
.car-tail { fill: #EF4444; }
.car-plate { fill: #F8FAFC; stroke: #94A3B8; stroke-width: .5; }
.siren.is-red { fill: #EF4444; } .siren.is-blue { fill: #3B82F6; }

/* The kick-about: two children pass a ball on the beach. */
.kid, .ball { pointer-events: auto; cursor: pointer; }
.kid-leg { transform-box: fill-box; transform-origin: 50% 0; }
.ball { transform: translate(var(--x), var(--y)); transition: transform 1s linear; }
.ball.to-far { transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))); }
.ball-hit { fill: transparent; }
.ball-shade { fill: rgb(15 23 42 / .22); }
.ball-skin { fill: #fff; }
.ball-patch { fill: #1E293B; }
.ball-seam { fill: none; stroke: #1E293B; stroke-width: .7; }
.ball-dark { fill: rgb(15 23 42 / .18); }
.ball-edge { fill: none; stroke: #0F172A; stroke-width: 1.1; }
/* The ball flies as one; only its patches spin */
.ball-spin { transform-box: fill-box; transform-origin: center; }
.ball.hop .ball-fly { animation: ball-hop 1s ease-out; }
.ball.kick .ball-fly { animation: ball-kick 1s ease-out; }
.ball.hop .ball-spin { animation: ball-turn 1s linear; }
.ball.kick .ball-spin { animation: ball-turn .5s linear 2; }
@keyframes ball-hop { 50% { transform: translateY(-15px); } }
@keyframes ball-kick { 45% { transform: translateY(-46px); } }
@keyframes ball-turn { to { transform: rotate(360deg); } }

/* ── The sky word: a signature in light, day and night ── */
.pen-path { fill: none; stroke: #fff; stroke-width: 17; stroke-linecap: round; stroke-linejoin: round; }
.trail { fill: rgb(176 188 255 / .42); }
.trail-glow { fill: #FFD36B; filter: blur(6px); }
.trail-lit { fill: #FFF3B0; }
body.is-day .trail { fill: #fff; stroke: rgb(40 90 170 / .16); stroke-width: 2.4; paint-order: stroke; }
body.is-day .trail-glow { fill: #FFAE1F; opacity: .8; filter: blur(5px); }
body.is-day .trail-lit { fill: #FFC533; stroke: #F59E0B; stroke-width: .8; }
/* Weak devices skip the blur */
body.is-lite .trail-glow { opacity: .22; filter: none; }
/* Its work done, the pilot hovers by the last letter */
.pilot.is-home { animation: pilot-hover 9s ease-in-out infinite; }
body.is-lite .pilot.is-home { animation: none; }

/* At night, paper lanterns leave the roofs on sending */
.lantern { animation: lantern-rise 5s ease-out both; }
.lantern-body { fill: #FFB84D; }
.lantern-glow { fill: #FFD36B; opacity: .28; }
.lantern-flame { fill: #FFF7D6; }

/* ── The cable from the card to the generator ── */
.auth-cable { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; }
.auth-cable.is-laid { opacity: 1; }
.cable, .cable-shade, .cable-flow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cable { stroke: #F59E0B; }
.cable-shade { stroke: rgb(0 0 0 / .22); transform: translateY(3px); }
body.is-day .cable-shade { stroke: rgb(30 42 120 / .16); }
.cable-flow { stroke: #FFF7D6; stroke-dasharray: 4 24; opacity: 0; transition: opacity .4s; }
body.is-charged .cable-flow { opacity: .95; animation: cable-flow .8s linear infinite; }
body.is-cut .cable-flow, body.is-repair .cable-flow { opacity: 0; }
/* A cut or repair pulls the plug; typing restores it */
.plug-in { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
body.is-cut .plug-in, body.is-repair .plug-in { transform: translateX(-16px) rotate(-7deg); }
.cable-spark { fill: #FFF7D6; stroke: #F59E0B; stroke-width: 1.5; }
.plug-body { fill: #1E293B; stroke: rgb(255 255 255 / .25); stroke-width: 1; }
.plug-neck { fill: #B45309; }
.plug-pin { fill: none; stroke: #CBD5E1; stroke-width: 2.6; stroke-linecap: round; }

/* Robot moods, shared by the card robot and the team */
.eyes-happy, .eyes-sad, .eyes-wow, .shy-arms { display: none; }
[data-mood="happy"] .eyes, [data-mood="sad"] .eyes, [data-mood="shy"] .eyes { display: none; }
[data-mood="wow"] .eyes { display: none; }
[data-mood="happy"] .eyes-happy, [data-mood="sad"] .eyes-sad, [data-mood="wow"] .eyes-wow, [data-mood="shy"] .shy-arms, [data-mood="peek"] .shy-arms { display: inline; }
[data-mood="shy"] .arm-front, [data-mood="shy"] .arm-back, [data-mood="peek"] .arm-back { display: none; }
[data-mood="peek"] .shy-arms .arm-r, [data-mood="peek"] .shy-arms .hand-r { display: none; }
[data-mood="wow"] .bot { animation: hop .35s ease-out 1; }
[data-mood="happy"] .bot { animation: cheer .55s ease-out 4; }
[data-mood="sad"] .bot { transform-box: fill-box; transform-origin: 50% 100%; animation: shake .45s ease-in-out 2; }

/* Sound and sky buttons in the corner */
.scene-sound { position: fixed; top: 24px; left: 24px; z-index: 3; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgb(255 255 255 / .25); border-radius: 50%; background: rgb(255 255 255 / .08); color: #fff; font-size: 18px; cursor: pointer; }
.scene-sky { left: 76px; }
body.is-day .scene-sound { color: #1E2A78; border-color: rgb(30 42 120 / .25); background: rgb(255 255 255 / .5); }
/* The day and night switch cross-fades the whole island */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .9s; animation-timing-function: ease-in-out; }

/* Scene motion */
@keyframes sun-turn { to { transform: rotate(360deg); } }
@keyframes sun-breathe { from { opacity: .55; transform: scale(.94); } to { opacity: 1; transform: scale(1.06); } }
@keyframes pilot-hover { 25% { translate: -14px -8px; } 50% { translate: -4px 6px; } 75% { translate: 10px -5px; } }
@keyframes plate-in { from { opacity: 0; transform: translateY(26px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scaleY(.5); } }
@keyframes crew-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes cloud-sway { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes twinkle { 50% { opacity: .12; } }
@keyframes glint { 50% { opacity: .1; } }
@keyframes lantern-rise { from { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } to { opacity: 0; transform: translate(var(--sway), -300px); } }
@keyframes cable-flow { to { stroke-dashoffset: 28; } }
@keyframes burst { 0% { opacity: 1; transform: scale(.3); } 12% { opacity: 0; transform: scale(1.2); } 100% { opacity: 0; } }
@keyframes blink { 0%, 92%, 100% { transform: none; } 96% { transform: scaleY(.12); } }
@keyframes done-pop { 0% { opacity: 0; transform: translateY(6px); } 4%, 16% { opacity: 1; transform: none; } 22%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes warn-blink { 50% { opacity: .3; } }
@keyframes lamp-blink { 50% { opacity: .25; } }
@keyframes puff { 0% { opacity: .4; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(-10px, -40px) scale(2); } }
@keyframes fish-jump { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 60% { opacity: 1; transform: translateY(-30px) rotate(-25deg); } 100% { opacity: 0; transform: translateY(4px); } }
@keyframes hop { 50% { transform: translateY(-8px); } }
@keyframes cheer { 50% { transform: translateY(-12px); } }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes rumble { 50% { transform: translate(.5px, -.4px); } }
@keyframes rumble-hard { 25% { transform: translate(-1.2px, .5px); } 75% { transform: translate(1.2px, -.8px); } }

/* Narrow or upright windows, as in auth.css: the buttons stack */
@media (max-width: 640px), (orientation: portrait) {
    .scene-sound { position: absolute; top: 14px; left: auto; right: 14px; width: 38px; height: 38px; font-size: 16px; }
    .scene-sky { top: 60px; right: 14px; }
}
