/* Shared by the Creamies pages (Home, Kiosk, Validator, Meltdown) – used by all Creamies web apps through a symlink src/shared in each app. */

/* Footer */
.cr-footer { display: flex; justify-content: center; gap: 4px; padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, .26); background: rgba(19, 81, 155, .22); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
.cr-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; padding: 5px 12px; font-size: 15px; transition: color .2s; }
.cr-footer a:hover, .cr-footer a:focus-visible { color: #fff; }
.cr-footer a:focus-visible { outline: none; }
.cr-footer { align-items: center; overflow-x: clip; } /* the IOTA logo's empty SVG margin must not widen the page */
.cr-powered { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 0; color: #fff; opacity: .55; font-size: 12px; white-space: nowrap; } /* far right; text and logo a bit see-through; links stay centred */
@media (max-width: 560px) { /* no room for centred links + right block: links left, "powered by" right */
  .cr-footer:has(.cr-powered) { justify-content: flex-start; }
  .cr-powered { position: static; transform: none; margin-left: auto; }
  .cr-powered-text { display: none; } /* phones: just the IOTA logo */
}
.cr-powered { opacity: 1; } /* "powered by" and the IOTA logo always fully white */
.cr-powered img { display: block; height: 40px; width: auto; margin: -11px -12px -11px -5px; } /* the SVG has wide empty margins left and right */

/* Imprint and privacy pages */
.cr-legal { position: relative; box-sizing: border-box; width: 100%; padding: 64px 24px 40px; color: #fff; text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; line-height: 1.55; }
/* Imprint: text centred vertically, close button at the same spot as on the privacy page */
.cr-legal.cr-imprint .cr-legal-inner { display: flex; flex-direction: column; justify-content: center; min-height: calc(70vh - 64px); }
.cr-legal-inner { max-width: 760px; margin: 0 auto; }
.cr-legal h2 { margin: 0 0 22px; font-size: 26px; }
.cr-legal p { margin: 0 0 16px; }
.cr-legal b { display: inline-block; margin-bottom: 4px; padding: 3px 10px; border-radius: 20px; background: rgba(255, 255, 255, .22); }
.cr-legal section { margin-top: 30px; }
.cr-legal section.cr-sub { margin-top: 22px; }
.cr-legal .cr-heading { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 20px; background: rgba(255, 255, 255, .22); font-weight: 700; }
.cr-legal .cr-sub .cr-heading { background: rgba(255, 255, 255, .14); font-weight: 600; }
.cr-legal-note { opacity: .75; font-size: 14px; }
/* Close button stays in view while the text scrolls (pages can move it below a fixed header via --cr-close-top) */
.cr-legal-close { position: sticky; top: var(--cr-close-top, 16px); z-index: 2; margin: -48px 0 8px -8px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; text-decoration: none; font-size: 16px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); }
.cr-legal-close:hover { background: rgba(255, 255, 255, .26); }

/* Language switch: round flag button with a small menu */
.cr-lang { position: relative; }
.cr-lang-current { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14); cursor: pointer; transition: background .15s; }
.cr-lang-current:hover { background: rgba(255, 255, 255, .22); }
.cr-flag { display: inline-flex; width: 22px; height: 15px; flex: none; border-radius: 3px; overflow: hidden; }
.cr-flag svg { display: block; width: 100%; height: 100%; max-width: none; }
.cr-lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1000; min-width: 160px; padding: 6px; border-radius: 14px; background: #1a5fae; border: 1px solid rgba(255, 255, 255, .45); box-shadow: 0 14px 36px rgba(2, 20, 50, .45); }
.cr-lang-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: #fff; font: 600 15px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: left; cursor: pointer; }
.cr-lang-menu button:hover { background: rgba(255, 255, 255, .12); }
.cr-lang-menu button.on { background: rgba(255, 255, 255, .18); }

/* Button back to the start page: same round glass as the language button */
.cr-home { display: grid; place-items: center; flex: none; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; transition: background .15s; }
.cr-home:hover { background: rgba(255, 255, 255, .22); }
.cr-home:focus-visible { outline: 2px solid #ffc2d6; outline-offset: 2px; }

/* Header bar (Validator, Meltdown) – same look as the Kiosk header */
.cr-header { position: relative; z-index: 20; flex: none; box-sizing: border-box; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px max(24px, calc((100% - 1180px) / 2 + 24px)); background: rgba(19, 81, 155, .72); border-bottom: 1px solid rgba(255, 255, 255, .26); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
.cr-brand { display: flex; align-items: center; gap: 14px; margin: 0; --logo-h: 48px; }
.cr-brand img { display: block; width: auto; height: var(--logo-h); position: relative; top: calc(var(--logo-h) * .134); filter: drop-shadow(0 4px 10px rgba(10, 40, 90, .35)); }
.cr-brand span { line-height: 1.1; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .45); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.cr-brand span.cr-solo { padding-left: 0; border-left: 0; } /* app name alone, without logo */
.cr-header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cr-header button[data-dapp-kit] { height: 44px; min-height: 0 !important; padding: 0 16px !important; border-radius: 999px !important; background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .45) !important; box-shadow: none !important; transition: background .15s; }
.cr-header button[data-dapp-kit]:hover { background: rgba(255, 255, 255, .22) !important; }
.cr-header button[data-dapp-kit], .cr-header button[data-dapp-kit] * { color: #fff !important; font-size: 14px !important; font-weight: 600 !important; }
@media (max-width: 640px) {
  .cr-header { padding: 10px 16px; }
  .cr-brand { gap: 10px; --logo-h: 38px; }
  .cr-brand span { padding-left: 10px; letter-spacing: .16em; font-size: 12px; }
}
/* Very narrow: the app name next to the logo goes (the page title shows it), so logo and buttons fit in one row */
@media (max-width: 420px) {
  .cr-brand:has(.cr-home) span:not(.cr-solo) { display: none; } /* only when the start-page button needs the room */
}
/* Creamies start page – same blue sky and pink candy as the Kiosk. */
:root {
  --sky-top: #13519b; --sky-bot: #2f9ff0;
  --panel: rgba(255, 255, 255, .14); --panel-hover: rgba(255, 255, 255, .2); --line: rgba(255, 255, 255, .26);
  --muted: rgba(255, 255, 255, .78); --pink: #ffc2d6; --pill: #ec6f9d;
}
html { background: var(--sky-bot); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--sky-top), var(--sky-bot)) fixed; color: #fff; font: 15px/1.45 ui-rounded, "SF Pro Rounded", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#root { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; } /* tiles centred in the space between header and footer */
.cr-footer { position: sticky; bottom: 0; z-index: 4; }
a:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

/* Header like on the apps (only the language switch here); it stays on top, so the legal close button goes below it */
.cr-header { position: sticky; top: 0; }
:root { --cr-close-top: 86px; }
.cr-brand img { top: calc(var(--logo-h) * .134 - 3px); } /* CREAM logo a touch higher, so it lines up with DASHBOARD */

/* Four big tiles (2×2) filling the whole space between header and footer: animation on top, text below. */
.home { flex: 1; display: flex; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; } /* on big monitors the tiles stop growing sideways */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.apps { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(240px, 1fr)); gap: 16px; }
.app { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(4, 30, 70, .22); color: #fff; text-decoration: none; text-align: center; transition: transform .18s, background .18s, box-shadow .18s; }
a.app:hover { transform: translateY(-3px); background: var(--panel-hover); box-shadow: 0 16px 36px rgba(4, 30, 70, .3); }
.app-art { position: relative; flex: 1; min-height: 0; }
.app-art .art { position: absolute; inset: 4% 0 0; width: 100%; height: 96%; background: radial-gradient(circle closest-side, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0)); } /* square scene, centred in whatever space is left; the glow fades out fully inside the box */
.app-text { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 20px 20px; }
.app-text h2 { margin: 0; font-size: clamp(17px, 2.2vw, 26px); line-height: 1.15; letter-spacing: -.015em; }
/* Titles: logo + word side by side; the logos' drips hang below, so they sit a little low */
.app-text h2 { display: flex; align-items: center; justify-content: center; gap: .5em; flex-wrap: wrap; }
/* words styled like the app name in the header: bold, upper case, wide letter spacing; divider as tall as that text */
.app-text h2 span { font-size: .78em; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; line-height: 1.1; white-space: nowrap; }
.app-sep { width: 1px; height: .86em; background: rgba(255, 255, 255, .45); }
.app-logo { display: block; height: 1.65em; width: auto; transform: translateY(.18em); }
.app-logo-cream { height: 1.45em; }
.app-logo-meltdown { height: 1.8em; transform: translateY(.24em); }
.app-text p { margin: 0; color: var(--muted); font-size: clamp(13px, 1.25vw, 16px); max-width: 40ch; }
.app-soon { position: absolute; top: 14px; right: 14px; z-index: 1; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(8, 40, 82, .32); border: 1px solid rgba(255, 255, 255, .16); }

/* Not released yet */
.app.off { cursor: default; }
.app.off .app-art .art { filter: grayscale(1); opacity: .55; }
.app.off .app-text { opacity: .6; }

/* Phones: one tile per row (the page scrolls), animation on top, text below */
@media (max-width: 600px) {
  .home { padding: 12px; }
  .apps { gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: 270px; }
  .app { border-radius: 20px; }
  .app-text { padding: 2px 10px 14px; }
  .app-text h2 { font-size: 18px; }
  .app-text p { font-size: 14px; line-height: 1.35; }
  a.app:hover { transform: none; }
}
/* Animated tile scenes (Art.tsx). Elements rotate/scale around points in the 200×200 view box;
   ".fb" elements scale around their own centre instead. Slow, eased motion throughout. */
.art { --ease: cubic-bezier(.45, 0, .25, 1); display: block; width: 100%; height: 100%; overflow: visible; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.art * { transform-box: view-box; }
.art .fb { transform-box: fill-box; transform-origin: center; }
.art-text { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; font-weight: 800; letter-spacing: .08em; } /* size comes from each fontSize attribute */
a.app:hover .art { transform: scale(1.04); }

/* Kiosk: the card stack floats, the Creamie on the card changes every 3 s with a sheen, sparkles twinkle */
.k-float { animation: k-float 6s var(--ease) infinite alternate; }
@keyframes k-float { from { transform: translateY(2px); } to { transform: translateY(-5px); } }
.k-floor { transform-origin: 100px 176px; animation: k-floor 6s var(--ease) infinite alternate; }
@keyframes k-floor { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(.86); opacity: .65; } }
.k-fan-l, .k-fan-r { transform-origin: 100px 150px; animation: k-fan-l 6s var(--ease) infinite alternate; }
.k-fan-r { animation-name: k-fan-r; }
@keyframes k-fan-l { from { transform: rotate(0) translateX(0); } to { transform: rotate(-3deg) translateX(-2px); } }
@keyframes k-fan-r { from { transform: rotate(0) translateX(0); } to { transform: rotate(3deg) translateX(2px); } }
.k-slide { opacity: 0; animation: k-show 9s ease-in-out infinite; }
@keyframes k-show { 0% { opacity: 0; } 6%, 33.3% { opacity: 1; } 40%, 100% { opacity: 0; } }
.k-pop { transform-origin: 100px 100px; animation: k-pop 9s var(--ease) infinite; }
@keyframes k-pop {
  0% { transform: translateY(7px) scale(.93); }
  9%, 33.3% { transform: translateY(0) scale(1); }
  40%, 100% { transform: translateY(-5px) scale(.97); }
}
.k-shine { animation: k-shine 3s cubic-bezier(.6, 0, .3, 1) .25s infinite; transform: translateX(-30px); }
@keyframes k-shine { 0% { transform: translateX(-30px); } 45%, 100% { transform: translateX(160px); } }
.k-spark { animation: k-spark 3.6s ease-in-out infinite; }
@keyframes k-spark { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(90deg); opacity: .95; } }

/* Validator: the core breathes and draws its check, pulses roll out, the badge's dot pings (orbits are SMIL) */
.v-core { transform-origin: 100px 96px; animation: v-breathe 4s var(--ease) infinite alternate; }
@keyframes v-breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
.v-glow { animation: v-glow 4s var(--ease) infinite alternate; }
@keyframes v-glow { from { opacity: .7; } to { opacity: 1; } }
.v-pulse { opacity: 0; transform-origin: 100px 96px; animation: v-pulse 4s cubic-bezier(.15, .6, .3, 1) infinite; }
@keyframes v-pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.5); opacity: 0; } }
.v-check { stroke-dasharray: 34; animation: v-check 6s var(--ease) infinite; }
@keyframes v-check {
  0%, 8% { stroke-dashoffset: 34; opacity: 1; }
  26%, 86% { stroke-dashoffset: 0; opacity: 1; }
  96%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
.v-live { animation: v-live 2s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes v-live { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }

/* Meltdown: one 8 s cycle – the TPS climbs into the red, jitters at the top, falls back.
   Fill, glowing head, heat and drips share the same keyframe times and easings, so they stay in sync. */
.m-fill { stroke-dasharray: 100 200; animation: m-fill 8s ease-in-out infinite; }
@keyframes m-fill {
  0% { stroke-dashoffset: 88; animation-timing-function: cubic-bezier(.55, 0, .3, 1); }
  50% { stroke-dashoffset: 7; } 54% { stroke-dashoffset: 10; } 58% { stroke-dashoffset: 5; } 62% { stroke-dashoffset: 9; }
  66% { stroke-dashoffset: 6; animation-timing-function: linear; }
  80% { stroke-dashoffset: 6; animation-timing-function: cubic-bezier(.5, 0, .25, 1); }
  100% { stroke-dashoffset: 88; }
}
.m-head { transform-origin: 100px 110px; animation: m-head 8s ease-in-out infinite; }
@keyframes m-head {
  0% { transform: rotate(28.8deg); animation-timing-function: cubic-bezier(.55, 0, .3, 1); }
  50% { transform: rotate(223.2deg); } 54% { transform: rotate(216deg); } 58% { transform: rotate(228deg); } 62% { transform: rotate(218.4deg); }
  66% { transform: rotate(225.6deg); animation-timing-function: linear; }
  80% { transform: rotate(225.6deg); animation-timing-function: cubic-bezier(.5, 0, .25, 1); }
  100% { transform: rotate(28.8deg); }
}
.m-heat { animation: m-heat 8s ease-in-out infinite; }
@keyframes m-heat {
  0% { opacity: .12; animation-timing-function: cubic-bezier(.55, 0, .3, 1); }
  50% { opacity: .85; animation-timing-function: linear; }
  80% { opacity: .85; animation-timing-function: cubic-bezier(.5, 0, .25, 1); }
  100% { opacity: .12; }
}
.m-stem { transform-origin: 100px 91px; animation: m-stem 8s ease-in-out infinite; }
@keyframes m-stem {
  0% { transform: scaleY(1); animation-timing-function: cubic-bezier(.55, 0, .3, 1); }
  50% { transform: scaleY(2.4); animation-timing-function: linear; }
  80% { transform: scaleY(2.4); animation-timing-function: cubic-bezier(.5, 0, .25, 1); }
  100% { transform: scaleY(1); }
}
.m-bulb { animation: m-bulb 8s ease-in-out infinite; }
@keyframes m-bulb {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(.55, 0, .3, 1); }
  50% { transform: translateY(calc(var(--len) * 1.4px)); animation-timing-function: linear; }
  80% { transform: translateY(calc(var(--len) * 1.4px)); animation-timing-function: cubic-bezier(.5, 0, .25, 1); }
  100% { transform: translateY(0); }
}
.m-drop { opacity: 0; animation: m-drop 8s infinite; }
@keyframes m-drop {
  0%, 52% { transform: translateY(0); opacity: 0; }
  53% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.5, 0, 1, 1); }
  64%, 100% { transform: translateY(22px); opacity: 0; }
}

/* Game: the keyframes are computed in Art.tsx (gameCss) so shots and hits line up with the running fighters. */

@media (prefers-reduced-motion: reduce) {
  .art, .art * { animation: none !important; transition: none !important; }
  .k-slide.k-first { opacity: 1; } /* still image: show the first Creamie */
}
