/* The look of the 3D explanation (see player3d.ts), shared by the website and the desktop app. The page it is on may set --display, --ink and --gold; without them it uses its own. */
.m3 { --m3-font: var(--display, 'Fredoka', 'Segoe UI', system-ui, sans-serif); --m3-ink: var(--ink, #f3eee4); --m3-gold: var(--gold, #f5b82e); font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif; }
/* ---- The 3D explanation: shapes lit like a product shot, turned with a finger, told one step at a time ---- */
.m3 { position: fixed; inset: 0; z-index: 31; display: grid; justify-items: center; align-items: start; padding: 58px 10px 0; pointer-events: none; opacity: 0; transform: translateY(10px) scale(0.985); transition: opacity 0.26s ease, transform 0.32s cubic-bezier(.2,.8,.2,1); }
.m3[hidden] { display: none; } .m3.in { opacity: 1; transform: none; } .m3.closing { opacity: 0; transform: translateY(8px) scale(0.99); }
.m3-card { pointer-events: auto; width: min(900px, 100%); border-radius: 24px; background: linear-gradient(180deg, #1c1540 0%, #120c2b 100%); border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(124, 92, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06); overflow: hidden; display: grid; }
.m3-top { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 20px; }
.m3-top b { flex: 1; font: 700 19px var(--m3-font); letter-spacing: 0.1px; color: var(--m3-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3-top b::after { content: ''; display: block; width: 44px; height: 3px; margin-top: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--m3-gold), transparent); }
.m3-tools { display: flex; gap: 6px; }
.m3-tool { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.06); color: var(--m3-ink); display: grid; place-items: center; cursor: pointer; transition: background 0.15s, transform 0.15s, opacity 0.2s; }
.m3-tool:hover { background: rgba(255, 255, 255, 0.14); } .m3-tool:active { transform: scale(0.94); } .m3-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#m3-reset { opacity: 0; pointer-events: none; transform: scale(0.8); } #m3-reset.on { opacity: 1; pointer-events: auto; transform: none; }
.m3-tool .i-play { display: none; } .m3-tool.is-paused .i-play { display: block; fill: currentColor; stroke-width: 1.4; } .m3-tool.is-paused .i-pause { display: none; }
.m3-seg { display: flex; gap: 5px; padding: 4px 20px 10px; }
.m3-step { flex: 1; height: 16px; padding: 6px 0; border: 0; background: none; cursor: pointer; } .m3-step i { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); position: relative; overflow: hidden; transition: background 0.3s; }
.m3-step.done i { background: linear-gradient(90deg, #7c5cff, #a78bfa); } .m3-step.now i { background: rgba(255, 255, 255, 0.18); } .m3-step.now i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #7c5cff, #ffd66b); transform-origin: left; animation: m3-fill var(--dur, 6s) linear forwards; }
.m3-step.more { flex: 0.35; cursor: default; } .m3-step.more i { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 6px, transparent 6px 10px); animation: m3-more 1.2s ease-in-out infinite; } @keyframes m3-more { 50% { opacity: 0.35; } }
.m3-note { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 13px; border-radius: 13px; background: rgba(16, 10, 38, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(143, 230, 255, 0.45); color: #d9d2f6; font-size: 13.5px; line-height: 1.35; pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease; }
.m3-note.on { opacity: 1; transform: none; } .m3-note b { font: 700 14px var(--m3-font); color: #fff; }
.m3-canvas:focus-visible { outline: 2px solid rgba(255, 214, 107, 0.8); outline-offset: -2px; }
@keyframes m3-fill { from { transform: scaleX(0.06); } to { transform: scaleX(1); } }
.m3-stage { position: relative; height: clamp(250px, 50vh, 500px); background: radial-gradient(110% 85% at 50% 42%, rgba(98, 70, 220, 0.34) 0%, rgba(40, 24, 96, 0.18) 45%, transparent 75%), radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0) 0 0 / 22px 22px; touch-action: none; }
.m3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; } .m3-canvas:active { cursor: grabbing; } .m3-stage.over .m3-canvas { cursor: pointer; }
.m3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.m3-pill { position: absolute; left: 0; top: 0; max-width: min(200px, 60%); padding: 5px 11px 6px; border-radius: 999px; background: rgba(16, 10, 38, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 214, 107, 0.6); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.8); color: #fff; opacity: 0; transition: opacity 0.2s ease; will-change: transform; white-space: nowrap; }
.m3-pill.on { opacity: 1; } .m3-pill b { display: block; font: 700 13px var(--m3-font); overflow: hidden; text-overflow: ellipsis; }
/* The line from the name to the part it points at, ending in a small dot on it. */
.m3-pill::after { content: ''; position: absolute; left: calc(50% + var(--tip, 0px) - 0.75px); top: 100%; width: 1.5px; height: var(--len, 24px); background: linear-gradient(180deg, rgba(255, 214, 107, 0.9), rgba(255, 214, 107, 0.55)); }
.m3-pill::before { content: ''; position: absolute; left: calc(50% + var(--tip, 0px) - 3.5px); top: calc(100% + var(--len, 24px) - 3px); width: 7px; height: 7px; border-radius: 50%; background: #ffd66b; box-shadow: 0 0 0 2px rgba(16, 10, 38, 0.7), 0 0 10px rgba(255, 214, 107, 0.9); }
.m3-pill.below::after { top: auto; bottom: 100%; } .m3-pill.below::before { top: auto; bottom: calc(100% + var(--len, 24px) - 3px); }
.m3-pill.pick { border-color: rgba(143, 230, 255, 0.7); } .m3-pill.pick::before { background: #8fe6ff; box-shadow: 0 0 0 2px rgba(16, 10, 38, 0.7), 0 0 10px rgba(143, 230, 255, 0.9); } .m3-pill.pick::after { background: rgba(143, 230, 255, 0.7); }
.m3-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: rgba(16, 10, 38, 0.7); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.1); color: #d9d2f6; font-size: 13px; pointer-events: none; transition: opacity 0.5s; }
.m3-hint svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; animation: m3-nudge 2.2s ease-in-out infinite; } .m3-hint.gone { opacity: 0; }
@keyframes m3-nudge { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(4px); } }
.m3-cap { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent); min-height: 74px; }
.m3-dot { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c4b0ff, #6d49e8 60%, #3c2394); box-shadow: 0 0 12px -2px rgba(124, 92, 255, 0.8); }
.m3-cap p { margin: 0; font-size: 17px; line-height: 1.45; color: var(--m3-ink); } .m3-cap p.in { animation: m3-say 0.45s ease both; } @keyframes m3-say { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .m3 { padding-top: 52px; } .m3-card { border-radius: 20px; } .m3-stage { height: clamp(240px, 46vh, 420px); } .m3-cap p { font-size: 16px; } .m3-top b { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .m3, .m3-pill { transition: none; } .m3-hint svg, .m3-step.now i::after { animation: none; } .m3-step.now i::after { transform: none; } }
/* ---- The 3D card, immersive: the model fills the whole card, and everything else floats over it lightly (a thin line of steps along the top edge, a small title, quiet buttons, the words as subtitles) ---- */
.m3-card { position: relative; background: #0d0920; border-color: rgba(255, 255, 255, 0.06); }
.m3-stage { height: clamp(340px, 66vh, 640px); }
.m3-seg { position: absolute; left: 0; right: 0; top: 0; z-index: 3; gap: 3px; padding: 0 14px; }
.m3-step { height: 18px; padding: 8px 0 7px; } .m3-step i { height: 3px; background: rgba(255, 255, 255, 0.16); }
.m3-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: 20px 12px 26px 18px; background: linear-gradient(180deg, rgba(8, 5, 22, 0.62), rgba(8, 5, 22, 0)); pointer-events: none; }
.m3-top b { font: 600 14.5px var(--m3-font); letter-spacing: 0.2px; color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); } .m3-top b::after { display: none; }
.m3-tools { pointer-events: auto; gap: 4px; }
.m3-tool { width: 32px; height: 32px; border-color: transparent; background: rgba(10, 6, 26, 0.34); color: rgba(255, 255, 255, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } .m3-tool svg { width: 16px; height: 16px; }
.m3-tool:hover, .m3-tool:focus-visible { background: rgba(255, 255, 255, 0.16); color: #fff; }
.m3-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; min-height: 0; justify-content: center; padding: 44px 22px 18px; border-top: 0; background: linear-gradient(0deg, rgba(8, 5, 22, 0.82) 0%, rgba(8, 5, 22, 0.5) 55%, rgba(8, 5, 22, 0) 100%); pointer-events: none; }
.m3-dot { display: none; }
.m3-cap p { max-width: 640px; text-align: center; font-size: 16.5px; line-height: 1.42; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6); text-wrap: balance; }
/* The line about a tapped part sits just under the title, and the hint just above the words, so neither covers the other. */
.m3-note { left: 14px; right: auto; bottom: auto; top: 50px; max-width: min(360px, calc(100% - 28px)); padding: 7px 12px; border-radius: 12px; background: rgba(10, 6, 26, 0.6); border-color: rgba(143, 230, 255, 0.3); transform: translateY(-4px); }
.m3-hint { bottom: 92px; padding: 5px 11px; font-size: 12px; background: rgba(10, 6, 26, 0.45); border-color: transparent; color: rgba(255, 255, 255, 0.75); }
.m3-pill { padding: 3px 9px 4px; background: rgba(10, 6, 26, 0.6); border-color: rgba(255, 214, 107, 0.45); box-shadow: none; } .m3-pill b { font-size: 12.5px; font-weight: 600; }
/* With a mouse the buttons and title step back while the story plays and come forward when the pointer is over the card (on a touch screen they stay as they are). */
/* While the story plays there is only the model and the words. The title, the line of steps and the buttons come up when it is paused or over. */
.m3-top, .m3-seg { opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; } .m3.ui .m3-top, .m3.ui .m3-seg { opacity: 1; visibility: visible; transition: opacity 0.22s ease; }
.m3-tool.is-paused { background: rgba(255, 214, 107, 0.92); color: #1c1540; }
/* On a phone the model has the whole screen. When the story is over it gives up the bottom of the screen to the follow-up buttons. */
@media (max-width: 560px) {
  .m3 { padding: 0; align-items: stretch; transition: opacity 0.26s ease, transform 0.32s cubic-bezier(.2,.8,.2,1), padding 0.3s ease; } .m3-card { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
  .m3-stage { height: 100%; } body.fin .m3 { padding-bottom: var(--dockh, 210px); } body.fin .m3-card { border-radius: 0 0 22px 22px; }
  .m3-top { padding: calc(18px + env(safe-area-inset-top)) 12px 26px 18px; } .m3-seg { top: env(safe-area-inset-top); } .m3-note { top: calc(52px + env(safe-area-inset-top)); }
  .m3-cap { padding: 44px 18px calc(22px + env(safe-area-inset-bottom)); } body.fin .m3-cap { padding-bottom: 18px; } .m3-cap p { font-size: 16.5px; } .m3-top b { font-size: 14px; } .m3-tool { width: 38px; height: 38px; } .m3-hint { bottom: 110px; }
}
/* Questions to carry on with, on the card once the story is over (where the host has no bar of its own for them). */
.m3-next { position: absolute; left: 0; right: 0; bottom: 74px; z-index: 3; display: none; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 0 16px; pointer-events: none; }
.m3.asks .m3-next { display: flex; }
.m3-next button { pointer-events: auto; max-width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(16, 10, 38, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font: 600 13.5px var(--m3-font); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, border-color 0.15s; }
.m3-next button:hover { background: rgba(124, 92, 255, 0.5); border-color: rgba(255, 214, 107, 0.6); }
