
:root{--pri:#5b3fd1;--pri2:#7c5cff;--ink:#22223a;--muted:#6b6b85;--bg:#f6f3ff;--card:#fff;--rad:16px;--noteW:clamp(128px,30vw,210px)}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"Heebo","Assistant","Rubik","Noto Sans Hebrew",system-ui,Arial,sans-serif;background:var(--bg);color:var(--ink);font-size:17px;line-height:1.5;padding-bottom:96px;-webkit-tap-highlight-color:transparent}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.top{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:linear-gradient(90deg,#5b3fd1,#8a5cf6);color:#fff;box-shadow:0 2px 10px #0002}
.brand{background:none;border:0;color:#fff;font-weight:800;font-size:18px;white-space:nowrap;display:flex;align-items:center;gap:6px;padding:6px 2px;min-height:44px}
.topnav{display:flex;gap:6px}
.tbtn{white-space:nowrap;background:#ffffff26;border:1px solid #ffffff55;color:#fff;border-radius:999px;padding:6px 12px;min-height:44px;font-weight:600;font-size:15px}
main{max-width:1200px;margin:0 auto;padding:12px}
.hero{background:linear-gradient(135deg,#fff7d6,#ffe1ef 60%,#e4ddff);border-radius:22px;padding:18px 16px;margin:4px 0 14px;box-shadow:0 3px 14px #5b3fd11a}
.hero h1{margin:0 0 6px;font-size:26px}
.hero p{margin:4px 0}
h2.sec{font-size:20px;margin:18px 4px 8px}
.small{font-size:14.5px}
.muted{color:var(--muted)}
.tpls{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.tpl{border:0;border-radius:18px;padding:14px 12px;text-align:right;min-height:118px;display:flex;flex-direction:column;gap:4px;box-shadow:0 3px 10px #0001;transition:transform .12s}
.tpl:active{transform:scale(.97)}
.tpl .em{font-size:30px;line-height:1}
.tpl b{font-size:17px}
.tpl span{font-size:13.5px;color:#444a}
.myboards{display:flex;flex-direction:column;gap:8px}
.mb{display:flex;align-items:center;gap:8px;background:#fff;border-radius:14px;padding:8px 10px;box-shadow:0 2px 8px #0001}
.mb .open{flex:1;background:none;border:0;text-align:right;padding:8px 4px;min-height:44px}
.mb .open b{display:block}
.mb .open span{font-size:13px;color:var(--muted)}
.mb .del{background:#fff0f0;border:0;border-radius:12px;min-width:44px;min-height:44px;font-size:18px}
.card{background:var(--card);border-radius:var(--rad);padding:14px 16px;margin:12px 0;box-shadow:0 2px 10px #0001}
.card h3{margin:0 0 6px}
.card p{margin:6px 0}
.card.honest{border-inline-start:6px solid #f5b400;background:#fffbea}
.importcard textarea{width:100%;border:2px solid #ddd6ff;border-radius:12px;padding:10px;margin:6px 0;direction:ltr;text-align:left;font-size:14px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--pri);color:#fff;border:0;border-radius:14px;padding:12px 18px;min-height:50px;font-weight:700;font-size:17px;text-decoration:none;box-shadow:0 3px 8px #5b3fd133}
.btn.ghost{background:#efeaff;color:var(--pri);box-shadow:none}
.btn.danger{background:#ffe8e8;color:#c62828;box-shadow:none}
.small-btn{min-height:40px;padding:6px 12px;font-size:15px}
/* board */
.ro-banner{background:#fff3c4;border-radius:14px;padding:10px 12px;margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-weight:600}
.bhead{display:flex;align-items:flex-start;gap:8px}
.btitles{flex:1;min-width:0}
.btitles h1{margin:2px 0;font-size:clamp(22px,5.4vw,40px);line-height:1.25;overflow-wrap:anywhere}
.btitles p{margin:2px 0 6px;color:var(--muted);font-size:16px}
.iconbtn{background:#fff;border:0;border-radius:14px;min-width:50px;min-height:50px;font-size:22px;box-shadow:0 2px 8px #0002}
.flags{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 8px}
.flag{background:#fff;border-radius:999px;padding:3px 10px;font-size:13.5px;box-shadow:0 1px 4px #0001}
.timer{display:flex;flex-wrap:wrap;align-items:center;gap:10px;background:#fff;border-radius:16px;padding:8px 12px;margin:6px 0 10px;box-shadow:0 2px 10px #0001}
.tdisp{font-size:38px;font-weight:800;font-variant-numeric:tabular-nums;direction:ltr;min-width:120px;text-align:center;color:var(--pri)}
.tdisp.low{color:#e53935}
.tdisp.done{animation:blink .6s 5}
@keyframes blink{50%{opacity:.2}}
.tbtns{display:flex;flex-wrap:wrap;gap:6px}
.chip{border:0;background:#efeaff;color:var(--pri);border-radius:999px;padding:8px 14px;min-height:44px;font-weight:700}
.chip.go{background:var(--pri);color:#fff}
.canvas{position:relative;border-radius:20px;min-height:62vh;box-shadow:inset 0 0 0 2px #0000000d;overflow:hidden}
.bg-cork{background:#d9b98a radial-gradient(#c9a46f 1.2px,transparent 1.3px) 0 0/14px 14px}
.bg-white{background:#fff}
.bg-grid{background:#fff linear-gradient(#e6e9f5 1px,transparent 1px) 0 0/100% 26px,#fff linear-gradient(90deg,#e6e9f5 1px,transparent 1px) 0 0/26px 100%}
.bg-dark{background:#263045}
.bg-dark .colhead{color:#fff}
.canvas.free{height:max(62vh,560px)}
.note{position:absolute;width:var(--noteW);min-height:96px;padding:10px 10px 8px;border-radius:6px 6px 14px 6px;box-shadow:0 4px 10px #0003;font-size:16px;line-height:1.35;user-select:none;-webkit-user-select:none;touch-action:none;cursor:grab;overflow-wrap:anywhere}
.note .ne{font-size:26px;line-height:1;display:block;margin-bottom:4px}
.note .nt{white-space:pre-wrap}
.note .nn{display:block;font-size:12.5px;opacity:.75;margin-top:6px}
.note .nl{position:absolute;bottom:4px;left:6px;font-size:12.5px;font-weight:700}
.note.dragging{cursor:grabbing;box-shadow:0 12px 24px #0004;z-index:20;transform:rotate(2deg) scale(1.04)}
.note.back{background:repeating-linear-gradient(45deg,#7c5cff,#7c5cff 10px,#6a4af0 10px,#6a4af0 20px)!important;color:#fff;display:flex;align-items:center;justify-content:center;font-size:38px}
.note.back>*{display:none}
.note.back::after{content:"❓"}
.note.pop{animation:pop .35s}
@keyframes pop{0%{transform:scale(.6)}70%{transform:scale(1.08)}100%{transform:scale(1)}}
.c0{background:#fff176}.c1{background:#ffab91}.c2{background:#a5d6a7}.c3{background:#81d4fa}.c4{background:#f48fb1}.c5{background:#ce93d8}.c6{background:#ffffff}
/* columns */
.canvas.cols{display:flex;flex-direction:column;gap:10px;padding:10px}
.col{flex:1 1 auto;background:#ffffffb8;border-radius:16px;padding:8px;display:flex;flex-direction:column;gap:8px;min-height:120px}
.bg-dark .col{background:#ffffff1a}
.col.over{outline:3px dashed var(--pri);outline-offset:-3px}
.colhead{font-weight:800;font-size:18px;padding:4px 6px;display:flex;justify-content:space-between;gap:6px}
.colhead .cnt{background:#0000000f;border-radius:999px;padding:0 9px;font-size:14px;align-self:center}
.cols .note{position:relative;width:auto;touch-action:auto;cursor:default;padding-inline-start:40px}
.cols .note .grip{position:absolute;inset-inline-start:0;top:0;bottom:0;width:36px;display:flex;align-items:center;justify-content:center;font-size:20px;opacity:.55;touch-action:none;cursor:grab}
.cols .note.back .grip{display:none}
.note .grip{display:none}
.cols .note .grip{display:flex}
.ghostnote{position:fixed;pointer-events:none;z-index:60;opacity:.9;width:200px}
.empty{text-align:center;color:var(--muted);margin:14px 0}
.printhint{text-align:center;margin-top:10px}
/* action bar */
.actionbar{position:fixed;bottom:0;inset-inline:0;z-index:40;display:flex;gap:6px;justify-content:center;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:#fffffff2;box-shadow:0 -3px 14px #0002;backdrop-filter:blur(6px)}
.abtn{flex:1;max-width:150px;display:flex;flex-direction:column;align-items:center;gap:1px;border:0;background:#f1edff;color:var(--pri);border-radius:14px;padding:6px 4px;min-height:58px;font-size:22px;font-weight:700}
.abtn span{font-size:13px}
.abtn.primary{background:var(--pri);color:#fff;flex:1.4}
#btnReveal{background:#ffcc33;color:#3a2a00}
/* footer */
.foot{display:flex;align-items:center;justify-content:center;gap:10px;padding:18px 12px 10px;color:var(--muted);font-weight:600}
.foot img{border-radius:10px;width:40px;height:40px;object-fit:contain}
/* sheets */
.sheet-bg{position:fixed;inset:0;background:#0006;z-index:70}
.sheet{position:fixed;z-index:80;inset-inline:0;bottom:0;max-height:92vh;overflow:auto;background:#fff;border-radius:22px 22px 0 0;padding:16px 16px calc(18px + env(safe-area-inset-bottom));box-shadow:0 -6px 30px #0003;max-width:640px;margin:0 auto;animation:up .2s}
@keyframes up{from{transform:translateY(40px);opacity:.4}}
.sheet h2{margin:0 0 10px;font-size:21px}
.sheet textarea,.sheet input:not([type=checkbox]){width:100%;border:2px solid #ddd6ff;border-radius:14px;padding:10px 12px;font-size:18px;background:#fbfaff}
.sheet textarea:focus,.sheet input:focus{outline:none;border-color:var(--pri)}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0}
.row>label{font-weight:700;min-width:62px}
.lbl{display:block;font-weight:700;margin:12px 0 4px}
.check{display:flex;align-items:center;gap:10px;margin:12px 0;font-weight:600;min-height:44px}
.check input{width:24px;height:24px;accent-color:var(--pri)}
.seg{display:flex;flex-wrap:wrap;gap:6px}
.seg button{border:2px solid #ddd6ff;background:#fff;border-radius:12px;padding:8px 12px;min-height:44px;font-weight:600}
.seg button.on{background:var(--pri);border-color:var(--pri);color:#fff}
.swatches{display:flex;gap:8px;flex-wrap:wrap}
.sw{width:44px;height:44px;border-radius:12px;border:3px solid #0000;box-shadow:0 1px 4px #0003}
.sw.on{border-color:var(--ink)}
.emojis{display:flex;flex-wrap:wrap;gap:4px}
.emojis button{width:44px;height:44px;border-radius:12px;border:2px solid transparent;background:#f6f3ff;font-size:22px;padding:0}
.emojis button.on{border-color:var(--pri);background:#e6dfff}
.sheet-btns{display:flex;gap:8px;margin-top:12px}
.sheet-btns .btn{flex:1}
.sheet-btns.wrap{flex-wrap:wrap}
.sheet-btns.wrap .btn{flex:1 1 140px}
.menu-btns{display:flex;flex-direction:column;gap:8px}
.menu-btns .btn{width:100%}
.menu-preview{padding:12px;border-radius:12px;margin-bottom:10px;font-size:18px;white-space:pre-wrap;overflow-wrap:anywhere}
#shareLink{direction:ltr;text-align:left;font-size:13px}
.toast{position:fixed;bottom:96px;left:50%;transform:translateX(-50%);background:#22223a;color:#fff;padding:10px 18px;border-radius:999px;z-index:90;font-weight:600;max-width:90vw;text-align:center}
/* read-only */
body.ro .editonly{display:none!important}
/* projector */
body.proj .top,body.proj .foot,body.proj .printhint{display:none}
body.proj main{max-width:none}
body.proj{--noteW:clamp(150px,18vw,260px)}
body.proj .note{font-size:20px}
@media (max-width:400px){.tbtn span{display:none}.tbtn{min-width:44px;padding:6px 10px}}
@media (min-width:760px){
  .canvas.cols{flex-direction:row;min-height:56vh}
  .col{flex:1 1 0;min-height:50vh}
  .tpls{grid-template-columns:repeat(3,1fr)}
  .actionbar{gap:10px}
  :root{--noteW:clamp(150px,17vw,220px)}
}
@media print{
  @page{margin:12mm}
  body{background:#fff;padding:0}
  .top,.actionbar,.sheet,.sheet-bg,.toast,.timer,.iconbtn,.printhint,.ro-banner,.flags,#home,#help{display:none!important}
  #board{display:block!important}
  .canvas,.canvas.free,.canvas.cols{background:#fff!important;height:auto!important;min-height:0;box-shadow:none;overflow:visible;display:flex;flex-wrap:wrap;gap:8px;padding:0}
  .canvas.cols{flex-wrap:nowrap}
  .col{background:#fff!important;border:1.5px solid #bbb;min-height:0;flex:1 1 0}
  .bg-dark .colhead{color:#000}
  .note,.cols .note{position:relative!important;left:auto!important;top:auto!important;width:31%;box-shadow:none;border:1px solid #999;-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;transform:none}
  .cols .note{width:auto;padding-inline-start:10px}
  .cols .note .grip{display:none}
  .note.back{background:#fff!important;color:#000}
  .note.back>*{display:block}.note.back::after{content:none}
  .foot{display:flex}
}
.codehelp{background:#f4f1ff;border-radius:12px;padding:8px 10px;margin:8px 0}
.codeline{font-weight:700;color:var(--pri);margin:4px 0 0}
ol.steps{margin:6px 0;padding-inline-start:22px}
ol.steps li{margin:6px 0}
