/* TICKARASHI — מערכת העיצוב. הצבעים לא כתובים כאן: ds.js קורא אותם מהפונט (THEME) של העולם שנבחר. */
:root {
  --bg: #6a25a3; --ink: #3e1470; --text: #e4ddb2; --soft: #c8b4e0; --accent: #36c7a0;
  --line: color-mix(in srgb, var(--text) 22%, transparent);
  --panel: color-mix(in srgb, var(--ink) 55%, var(--bg));
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Assistant', system-ui, sans-serif; -webkit-font-smoothing: antialiased; transition: background-color .7s var(--ease), color .7s; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: clamp(36px, 6vw, 72px); line-height: 1; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 700; letter-spacing: .08em; opacity: .7; margin: 28px 0 12px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .14em; opacity: .7; margin: 0 0 12px; }
.lede { font-size: 19px; line-height: 1.5; max-width: 36em; opacity: .85; margin: 16px 0 0; }
.note { font-size: 15px; line-height: 1.5; opacity: .75; margin: 0 0 8px; max-width: 46em; }

/* פתיחה: מגיעים מהלוגו באתר — המסך נפתח בעיגול */
.opening { position: fixed; inset: 0; z-index: 50; background: var(--bg); pointer-events: none; clip-path: circle(150% at 32px 32px); transition: clip-path .8s cubic-bezier(.7, 0, .3, 1); }
.opening.gone { clip-path: circle(0 at 32px 32px); }

/* כותרת קבועה: הלוגו (חזרה לאתר) והחלפת עולם */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.back { width: 56px; height: 40px; display: block; flex: none; }
.back svg { width: 100%; height: 100%; display: block; overflow: visible; }
.top-title { display: flex; flex-direction: column; line-height: 1.1; }
.top-title b { font-size: 17px; font-weight: 800; }
.top-title span { font-size: 11px; letter-spacing: .2em; opacity: .6; }
.worlds { margin-inline-start: auto; display: flex; gap: 6px; }
.worlds button { width: 52px; height: 52px; padding: 3px; border: 0; border-radius: 14px; background: transparent; transition: background .3s, transform .3s var(--ease); }
.worlds button.on { background: color-mix(in srgb, var(--text) 18%, transparent); }
.worlds button:hover { transform: translateY(-2px); }
.worlds svg { width: 100%; height: 100%; display: block; overflow: visible; }

.layout { display: grid; grid-template-columns: 180px 1fr; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.side { position: sticky; top: 92px; align-self: start; display: flex; flex-direction: column; gap: 2px; padding-top: 48px; }
.side a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 6px 10px; border-radius: 8px; opacity: .55; transition: opacity .2s, background .2s; }
.side a:hover, .side a.on { opacity: 1; background: color-mix(in srgb, var(--text) 12%, transparent); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { position: sticky; top: 77px; z-index: 9; flex-direction: row; overflow-x: auto; padding: 8px 0; background: var(--bg); scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
  .side::-webkit-scrollbar { display: none; }
  .side a { white-space: nowrap; }
}
main { min-width: 0; padding-bottom: 120px; }
main > section { padding: 56px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
main > section.intro { padding-top: 64px; }

/* צבעים */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.sw { border: 0; padding: 0; background: none; text-align: right; display: flex; flex-direction: column; gap: 6px; }
.sw i { display: block; height: 72px; border-radius: 14px; border: 1px solid var(--line); transition: transform .3s var(--ease); }
.sw:hover i { transform: translateY(-3px); }
.sw b { font-size: 14px; }
.sw span { font-size: 12px; opacity: .65; direction: ltr; text-align: right; }
.sw.copied span::after { content: ' · הועתק'; }

/* גריד */
.grid-box { border-radius: 20px; background: var(--panel); overflow: hidden; margin-top: 16px; padding: 12px; }
.grid-box svg { width: 100%; height: auto; max-height: 460px; display: block; }

/* טיפוגרפיה */
.type-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 860px) { .type-two { grid-template-columns: 1fr; } }
.card { background: var(--panel); border-radius: 20px; padding: 20px; }
.card h3 { margin-top: 0; }
.charset { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; margin-top: 12px; }
.charset svg { width: 100%; height: auto; display: block; overflow: visible; }
.spec { margin: 14px 0 0; line-height: 1.1; }
.spec.s1 { font-size: 44px; font-weight: 800; } .spec.s2 { font-size: 24px; font-weight: 700; }
.spec.s3 { font-size: 17px; font-weight: 600; } .spec.s4 { font-size: 13px; font-weight: 600; opacity: .7; }

/* מגרש האותיות */
.play { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-top: 16px; }
@media (max-width: 960px) { .play { grid-template-columns: 1fr; } }
.play-stage { position: relative; background: var(--panel); border-radius: 20px; min-height: 420px; padding: 16px; display: flex; flex-direction: column; }
.play-text { align-self: flex-start; font: 800 22px 'Assistant', sans-serif; letter-spacing: .12em; background: transparent; color: var(--text); border: 0; border-bottom: 2px solid var(--line); padding: 4px 2px; width: 12ch; outline: none; }
.play-text:focus { border-color: var(--accent); }
.play-svg { flex: 1; width: 100%; min-height: 300px; overflow: visible; margin: 12px 0; }
.play-svg g[data-i] { cursor: pointer; }
.play-svg g[data-i]:hover { filter: brightness(1.12); }
.play-actions { display: flex; gap: 8px; }
.play-actions button, .viewer-head button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.play-actions button:hover { border-color: var(--accent); }
.play-controls { background: var(--panel); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 14px; font-weight: 700; }
.ctl output { font-variant-numeric: tabular-nums; opacity: .7; direction: ltr; }
.ctl input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.viewer { margin-top: 16px; background: var(--panel); border-radius: 20px; padding: 14px; }
.viewer[hidden] { display: none; }
.viewer-head { display: flex; align-items: center; gap: 12px; }
.viewer-head b { font-size: 28px; font-weight: 800; min-width: 1.2em; }
.viewer-head button { margin-inline-start: auto; }
.brushes { display: flex; gap: 6px; flex-wrap: wrap; }
.brushes button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); padding: 0; }
.brushes button.on { border-color: var(--text); transform: scale(1.12); }
.viewer-3d { position: relative; height: min(70vh, 520px); margin: 10px 0; border-radius: 14px; background: color-mix(in srgb, var(--bg) 70%, #000 0%); }
.turn3d { position: absolute; inset-inline-start: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; z-index: 2; }
.turn3d-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: 320px; }
.turn3d-row span { width: 1.4em; font-weight: 700; text-align: center; }
.turn3d button { min-width: 34px; padding: 4px 8px; color: var(--ink); background: var(--text); border: 0; border-radius: 6px; font-weight: 700; }

/* צורות */
.cells { display: grid; gap: 8px; }
.cells.digits { grid-template-columns: repeat(10, 1fr); }
.cells.letters { grid-template-columns: repeat(8, 1fr); }
.cells.extras { grid-template-columns: repeat(4, minmax(0, 140px)); }
@media (max-width: 860px) { .cells.digits { grid-template-columns: repeat(5, 1fr); } .cells.letters { grid-template-columns: repeat(4, 1fr); } }
.cell { background: var(--panel); border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; align-items: center; transition: transform .2s; }
.cell:hover { transform: translateY(-3px); }
.cell svg { width: 100%; height: auto; display: block; overflow: visible; }
.cell small { font-size: 12px; opacity: .65; font-weight: 700; }

/* תנועה */
.motion { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 860px) { .motion { grid-template-columns: 1fr; } }
.mo { border-radius: 20px; padding: 18px; background: var(--mbg); color: var(--mtext); display: flex; flex-direction: column; gap: 12px; }
.mo .mo-box { height: 120px; display: grid; place-items: center; }
.mo .mo-box svg { width: auto; height: 120px; max-width: 100%; overflow: visible; display: block; }
.mo h4 { margin: 0; font-size: 20px; font-weight: 800; }
.mo p { margin: 0; font-size: 14px; opacity: .8; line-height: 1.45; }
.mo .row { display: flex; gap: 8px; }
.mo button { border: 1px solid currentColor; background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; color: inherit; }

/* רכיבים: מסכים אמיתיים של האפליקציה */
.comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 16px; }
.comp { display: flex; flex-direction: column; gap: 10px; }
.comp b { font-size: 17px; }
.comp p { margin: 0; font-size: 13px; opacity: .75; line-height: 1.45; }
.phone-wrap { width: 100%; aspect-ratio: 360 / 780; position: relative; }
.phone-frame { position: absolute; inset: 0; border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 6px #111, 0 20px 40px -20px rgba(0,0,0,.5); background: #111; }
.phone-frame iframe { position: absolute; left: 0; top: 0; width: 360px; height: 780px; border: 0; transform-origin: 0 0; transform: scale(var(--s, .6)); }

/* לוגו */
.logos { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; align-items: center; margin-top: 16px; }
@media (max-width: 760px) { .logos { grid-template-columns: 1fr 1fr; } .logos > :first-child { grid-column: 1 / -1; } }
.logos > div { background: var(--panel); border-radius: 20px; padding: 24px; display: grid; place-items: center; min-height: 160px; cursor: pointer; }
.logos svg { width: 100%; height: auto; max-height: 220px; display: block; overflow: visible; }
.logos > div:not(:first-child) svg { width: auto; height: 160px; max-width: 100%; }

.rules { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rules li { background: var(--panel); border-radius: 16px; padding: 16px; font-size: 15px; line-height: 1.5; }
.rules b { display: block; font-size: 17px; margin-bottom: 4px; }

/* בסוף: חזרה למעלה */
.to-top { display: inline-flex; align-items: center; gap: 10px; margin-top: 48px; padding: 14px 26px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 800; font-size: 17px; text-decoration: none; transition: transform .3s var(--ease); }
.to-top:hover { transform: translateY(-3px); }
.to-top span { font-size: 20px; }
