
:root{
  --blue:#139bd7;
  --orange:#ff7900;
  --ink:#17212b;
  --soft:#f5f7f9;
  --line:#dfe5ea;
}
*{box-sizing:border-box}
body{
  margin:0;background:#fff;color:var(--ink);
  font-family:Arial,"Noto Sans Hebrew",sans-serif;
}
button,input{font:inherit}
button{
  border:1px solid var(--line);background:#fff;border-radius:14px;
  padding:13px 16px;font-weight:700;cursor:pointer;
}
button:disabled{opacity:.45;cursor:not-allowed}
.primary{
  background:var(--orange);color:#fff;border:none;width:100%;
  box-shadow:0 6px 16px rgba(255,121,0,.18);
}
.ghost{background:var(--soft);width:100%}
.tiny{padding:7px 10px;border-radius:10px}
.linkbtn{display:block;text-align:center;text-decoration:none;padding:14px 16px;border-radius:14px;margin:14px 0}
.screen{display:none;min-height:100vh;padding:20px 16px 40px;max-width:760px;margin:auto}
.screen.active{display:block}
.brand{text-align:center;margin:10px auto 22px}
.brand h1{font-size:32px;margin:12px 0 6px}
.brand p{margin:0;color:#64717d}
.logo-card{
  width:118px;height:118px;object-fit:cover;border-radius:24px;
  box-shadow:0 10px 25px rgba(0,0,0,.12)
}
.panel{
  border:1px solid var(--line);border-radius:22px;padding:18px;
  background:#fff;box-shadow:0 8px 24px rgba(23,33,43,.05);
  margin:14px 0;
}
label{display:block;font-weight:700;margin-bottom:14px}
input{
  width:100%;margin-top:7px;padding:13px 14px;border:1px solid var(--line);
  border-radius:12px;background:#fff;outline:none;
}
input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(19,155,215,.12)}
.divider{display:flex;align-items:center;gap:10px;color:#87929b;margin:14px 0}
.divider:before,.divider:after{content:"";height:1px;background:var(--line);flex:1}
.notice{
  background:#fff7ec;border:1px solid #ffd8ae;color:#7a4300;
  padding:12px 14px;border-radius:14px;margin:12px 0;font-size:14px
}
.hidden{display:none!important}
.topbar{
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:10px;color:#53606b
}
.turn-banner{
  background:#eaf7fd;border:1px solid #c7eafb;border-radius:16px;
  padding:12px 14px;text-align:center;font-weight:700;margin-bottom:14px
}
.orange-wrap{text-align:center;margin:8px 0 18px}
.deck-label{font-size:13px;color:#64717d;margin-bottom:7px}
.orange-card{
  width:min(58vw,250px);aspect-ratio:1/1;object-fit:cover;border-radius:22px;
  box-shadow:0 10px 28px rgba(0,0,0,.14)
}
.cards-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.card-btn{
  border:none;background:none;padding:0;position:relative;border-radius:18px;
}
.card-btn img{
  width:100%;display:block;border-radius:18px;
  box-shadow:0 6px 18px rgba(0,0,0,.12);transition:.15s transform,.15s box-shadow
}
.card-btn:active img{transform:scale(.97)}
.card-btn.selected img{outline:5px solid var(--orange);outline-offset:-5px}
.players{display:flex;flex-direction:column;gap:9px}
.player-row,.score-row{
  display:flex;justify-content:space-between;align-items:center;
  background:var(--soft);padding:10px 12px;border-radius:12px
}
.muted{color:#6c7882}
.score-panel{margin-top:22px;border-top:1px solid var(--line);padding-top:12px}
.winner-card{
  width:min(55vw,220px);display:block;margin:12px auto;border-radius:18px;
  box-shadow:0 8px 22px rgba(0,0,0,.14)
}
.toast{
  position:fixed;left:50%;bottom:22px;transform:translateX(-50%);
  background:#17212b;color:white;padding:10px 14px;border-radius:12px;
  opacity:0;pointer-events:none;transition:.2s;z-index:100;max-width:90vw;text-align:center
}
.toast.show{opacity:1}
@media(min-width:620px){
  .cards-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .screen{padding-top:32px}
}


/* v0.5 — תחושת קלפים ביד ופתיחה משותפת */
.sound-btn{border:0;background:var(--soft);padding:7px 10px;border-radius:999px;min-width:44px;min-height:44px}
.fan-spread{perspective:900px}
.hand-card{transform-origin:50% 115%;will-change:transform,opacity}
.reveal-card{transform-origin:50% 100%;animation:liloReveal .5s cubic-bezier(.18,.85,.3,1) both;animation-delay:calc(var(--i) * 90ms)}
@keyframes liloReveal{
  0%{opacity:0;transform:translateY(34px) rotate(-5deg) scale(.78)}
  70%{opacity:1;transform:translateY(-4px) rotate(1deg) scale(1.02)}
  100%{opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){.hand-card,.reveal-card{animation:none!important}}


/* v0.6 — רגע זכייה מודגש */
.winner-card.winner-pop{animation:liloWinnerPop 1.05s cubic-bezier(.18,.85,.3,1) both}
@keyframes liloWinnerPop{
  0%{opacity:.55;transform:scale(.72) translateY(18px);filter:brightness(.95)}
  55%{opacity:1;transform:scale(1.16) translateY(-8px);filter:brightness(1.08);box-shadow:0 0 0 8px rgba(245,130,32,.12),0 18px 38px rgba(0,0,0,.22)}
  78%{transform:scale(1.08) translateY(-4px);box-shadow:0 0 0 4px rgba(245,130,32,.08),0 14px 30px rgba(0,0,0,.18)}
  100%{transform:scale(1.06) translateY(-3px);box-shadow:0 12px 28px rgba(0,0,0,.18)}
}
@media (prefers-reduced-motion:reduce){.winner-card.winner-pop{animation:none!important}}

/* v1.0 — mobile polish */
.join-primary{
  width:100%;
  background:var(--blue);
  color:#fff;
  border:none;
  box-shadow:0 6px 16px rgba(19,155,215,.18);
  margin-bottom:10px;
}
.join-primary:active{transform:scale(.99)}

/* v1.1 — light intro rules */
.quick-rules{
  margin:12px 2px 16px;text-align:center;color:#53606b;line-height:1.45;
}
.quick-rules h2{margin:0 0 8px;color:var(--ink);font-size:20px}
.quick-rules p{margin:7px 0;font-size:15px}
.quick-rules strong{color:var(--ink)}
.quick-rules-end{font-weight:700;color:var(--blue)!important}

/* v1.2 — Lilo welcome screen */
.lilo-welcome {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  line-height: 1.2;
  margin: .25rem 0 .7rem;
  font-weight: 800;
}
.lilo-before {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  margin-bottom: .75rem;
}
.lilo-captain { color: #2457c5; font-size: 1.08em; }
.lilo-pot { color: #d96b24; font-size: 1.08em; }
@media (max-width: 600px) {
  .intro-card, .welcome-card, .instructions-card { font-size: 1.08rem; line-height: 1.55; }
  .lilo-welcome { font-size: 1.8rem; }
}

/* v1.3 — stronger, playful welcome typography */
.lilo-welcome {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif !important;
  font-size: clamp(2rem, 6vw, 2.8rem) !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  margin: .55rem 0 .45rem !important;
  letter-spacing: .01em;
  background: linear-gradient(90deg, #2f6fd0, #8b4bc2, #e47735);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lilo-before {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif !important;
  font-size: clamp(1.45rem, 4.8vw, 1.85rem) !important;
  font-weight: 900 !important;
  margin: 1rem 0 .85rem !important;
}
@media (max-width: 600px) {
  .lilo-welcome { font-size: 2.05rem !important; }
  .lilo-before { font-size: 1.5rem !important; }
  .intro-card, .welcome-card, .instructions-card {
    font-size: 1.18rem !important;
    line-height: 1.65 !important;
  }
}

/* v1.4 */
.lilo-welcome{background:none!important;-webkit-background-clip:initial!important;background-clip:initial!important;color:inherit!important;}
.welcome-purple{color:#7b2fa1!important;}
.welcome-fuchsia{color:#ed145b!important;}
.captain-room{margin:1rem 0;}

/* v1.6 approved mobile welcome styling */
:root{--navy:#11185f;--purple:#7b2fa1;--fuchsia:#ed145b;--orange:#ff7418;}
body{background:#fff;color:var(--navy);}
.lilo-welcome{
  font-family:"Arial Rounded MT Bold","Trebuchet MS",Arial,sans-serif!important;
  font-size:clamp(3rem,8vw,5rem)!important;
  line-height:1.05!important;font-weight:900!important;margin:.55rem 0 .75rem!important;
}
.welcome-purple{color:#7b2fa1!important}
.welcome-fuchsia{color:#ed145b!important}
.intro-row{display:flex;flex-direction:row;align-items:center;gap:18px;max-width:650px;margin:24px auto;text-align:right;direction:rtl}
.intro-icon{width:76px;height:76px;border-radius:18px;display:flex;align-items:center;justify-content:center;font-size:34px;flex:0 0 76px}
.intro-chat .intro-icon{background:#dff9fb}
.captain-room{margin:0!important;flex:1}
button,.primary-btn,#createBtn,#joinBtn{border-radius:24px!important}
@media(max-width:600px){
 .lilo-welcome{font-size:3.2rem!important}
 .intro-row{gap:12px;margin:20px 10px}
 .intro-icon{width:64px;height:64px;flex-basis:64px;font-size:30px}
}

/* v1.7 — approved welcome screen restoration */
body{background:#fff;color:#11185f}
.lilo-welcome{
 font-family:"Arial Rounded MT Bold","Trebuchet MS",Arial,sans-serif!important;
 font-size:clamp(3.5rem,8.5vw,5.4rem)!important;
 line-height:1.02!important;font-weight:900!important;
 margin:.55rem auto .8rem!important;text-align:center!important;
}
.welcome-purple{color:#7b2fa1!important}
.welcome-fuchsia{color:#ed145b!important}

/* cream intro pill */
.intro-subtitle,.welcome-subtitle,.trial-note{
 display:inline-block!important;background:#fff5cf!important;
 border-radius:999px!important;padding:10px 26px!important;
 color:#11185f!important;font-weight:700!important;
}

/* Three instruction blocks: icon on RIGHT in Hebrew RTL */
.v17-title{font-weight:900;color:#11185f;font-size:1.35em}
.captain-room{
 position:relative!important;max-width:650px!important;
 margin:28px auto!important;padding-right:105px!important;
 min-height:82px!important;text-align:right!important;direction:rtl!important;
}
.captain-room::before{
 content:"💬";position:absolute;right:0;top:50%;transform:translateY(-50%);
 width:78px;height:78px;border-radius:18px;background:#dff9fb;
 display:flex;align-items:center;justify-content:center;font-size:38px;
}
@media(max-width:600px){
 .lilo-welcome{font-size:3.5rem!important}
 .captain-room{padding-right:86px!important;margin:22px 10px!important}
 .captain-room::before{width:66px;height:66px;font-size:32px}
}

/* Approved orange CTA feel */
button.primary,button[type="submit"],#joinBtn,#createBtn,.primary-btn{
 background:#ff7418!important;color:white!important;
 border-radius:24px!important;font-weight:800!important;
}

/* Exact closing line */
.v17-closing{color:#7b42d1!important;font-weight:900!important}

/* v1.8 — rebuilt welcome screen only; gameplay untouched */
#setupScreen{max-width:760px;padding:18px 18px 42px;color:#11185f}
.welcome-v18{font-family:Arial,"Noto Sans Hebrew",sans-serif}
.brand-v18{text-align:center}
.logo-v18{width:132px;height:132px;object-fit:cover;border-radius:26px;box-shadow:0 10px 28px rgba(0,0,0,.10)}
.brand-v18 h1{font-size:32px;margin:14px 0 20px;color:#11185f}
.brand-v18 h2{margin:0;font-family:"Arial Rounded MT Bold","Trebuchet MS",Arial,sans-serif;font-size:clamp(3.2rem,8vw,5rem);line-height:1.03;font-weight:900}
.brand-v18 h2 span,.brand-v18 h2 strong{display:block}
.brand-v18 h2 span{color:#7b2fa1}
.brand-v18 h2 strong{color:#ed145b}
.trial-pill{display:inline-block;margin:20px auto 28px;padding:11px 30px;border-radius:999px;background:#fff5cf;color:#11185f;font-size:20px;font-weight:700}
.rules-v18{max-width:610px;margin:0 auto}
.rule-v18{display:grid;grid-template-columns:82px 1fr;gap:20px;align-items:center;direction:rtl;text-align:right;margin:26px 0}
.rule-icon{grid-column:1;width:82px;height:82px;border-radius:20px;display:flex;align-items:center;justify-content:center}
.rule-icon svg{width:52px;height:52px;fill:none;stroke:currentColor;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.people-icon{background:#f0e8ff;color:#7436d8}.people-icon svg circle{fill:currentColor;stroke:none}.people-icon svg path{fill:currentColor;stroke:none}
.chat-icon{background:#ddf8fa;color:#087f91}.chat-icon svg circle{fill:currentColor;stroke:none}
.trophy-icon{background:#fde5ec;color:#dc2b65}
.rule-v18>div:last-child{grid-column:2}
.rule-v18 h3{font-size:25px;line-height:1.2;margin:0 0 5px;color:#11185f;font-weight:900}
.rule-v18 p{font-size:19px;line-height:1.45;margin:0;color:#20265c}
.closing-v18{text-align:center;margin:30px 0 24px;font-size:24px}
.closing-v18 span{color:#7b42d1;font-weight:900}
.entry-v18{max-width:680px;margin:0 auto!important}
.entry-v18 label{color:#11185f;text-align:right}
.entry-v18 input{font-size:18px;padding:16px;border-radius:18px}
.entry-v18 .primary,.entry-v18 .join-primary{background:#ff7418!important;color:#fff!important;border:0!important;border-radius:24px!important;font-size:21px;padding:17px}
#setupScreen #firebaseNotice{display:none}
@media(max-width:600px){
 #setupScreen{padding:18px 14px 36px}
 .logo-v18{width:126px;height:126px}
 .brand-v18 h1{font-size:29px;margin-bottom:18px}
 .brand-v18 h2{font-size:3.25rem}
 .trial-pill{font-size:16px;padding:10px 18px;margin:18px auto 22px}
 .rule-v18{grid-template-columns:70px 1fr;gap:14px;margin:22px 0}
 .rule-icon{width:70px;height:70px;border-radius:18px}
 .rule-icon svg{width:44px;height:44px}
 .rule-v18 h3{font-size:21px}
 .rule-v18 p{font-size:17px}
 .closing-v18{font-size:21px;margin:25px 0 20px}
}

/* v1.9 — only the requested mobile readability changes */
@media (max-width:700px){
  #roomCodeDisplay,#roomCodeGame{
    font-size:1.45em !important;
    font-weight:900 !important;
  }
  #submitInstruction,#judgeInstruction{
    font-size:1.28em !important;
    font-weight:900 !important;
    line-height:1.5 !important;
    color:#11185f !important;
  }
  #submitArea h2{
    font-weight:900 !important;
  }
}


/* v1.11 — highlight gameplay instructions only; no gameplay/layout changes */
#gameScreen #submitInstruction,
#gameScreen #judgeInstruction,
#gameScreen #readyText,
#gameScreen #waitingArea p,
#gameScreen #waitingNext{
  display:block;
  width:fit-content;
  max-width:min(92%, 820px);
  margin:10px auto 16px !important;
  padding:9px 18px !important;
  border-radius:14px;
  background:#e8f6ff;
  color:#11185f !important;
  font-size:1.18rem !important;
  font-weight:800 !important;
  line-height:1.5 !important;
  text-align:center;
  direction:rtl;
}
#gameScreen #roomCodeGame{
  display:inline-block;
  min-width:2.3em;
  padding:3px 10px;
  border-radius:10px;
  background:#e8f6ff;
  color:#11185f;
  font-size:1.35em;
  font-weight:900;
}
@media(max-width:700px){
  #gameScreen #submitInstruction,
  #gameScreen #judgeInstruction,
  #gameScreen #readyText,
  #gameScreen #waitingArea p,
  #gameScreen #waitingNext{
    max-width:94%;
    padding:10px 14px !important;
    font-size:1.22rem !important;
    font-weight:900 !important;
  }
  #gameScreen #roomCodeGame{
    font-size:1.55em !important;
  }
}


/* v1.12 — make gameplay instruction strips reliable on mobile */
#gameScreen #submitInstruction,
#gameScreen #judgeInstruction,
#gameScreen #readyText,
#gameScreen #waitingArea p,
#gameScreen #waitingNext {
  background-color:#e8f6ff !important;
  border:1px solid #ccecff !important;
  box-sizing:border-box;
}
@media (max-width:700px){
  #gameScreen #submitInstruction,
  #gameScreen #judgeInstruction,
  #gameScreen #readyText,
  #gameScreen #waitingArea p,
  #gameScreen #waitingNext {
    display:block !important;
    width:calc(100% - 24px) !important;
    max-width:680px !important;
    margin:10px auto 16px !important;
    padding:11px 14px !important;
    background-color:#e8f6ff !important;
    border:1px solid #ccecff !important;
    border-radius:14px !important;
    color:#11185f !important;
    font-size:1.22rem !important;
    font-weight:900 !important;
  }
}


/* v1.13 — clearer captain/join choice + instruction emphasis */
.entry-v18 .captain-choice{
  text-align:center;
  margin:4px 0 10px;
  padding:10px 12px;
  border-radius:14px;
  background:#fff7ed;
}
.entry-v18 .captain-title{
  color:#f57a1f;
  font-size:1.22rem;
  font-weight:900;
  margin-bottom:4px;
}
.entry-v18 .captain-note{
  color:#11185f;
  font-size:.98rem;
  line-height:1.45;
}
.entry-v18 .choice-divider span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:46px;
  min-height:46px;
  padding:0 10px;
  border-radius:999px;
  background:#e8f6ff;
  color:#11185f;
  font-size:1.25rem;
  font-weight:900;
}
.entry-v18 .join-choice-title{
  color:#11185f;
  font-size:1.12rem;
  font-weight:900;
  text-align:right;
  margin:2px 0 2px;
}
.entry-v18 .join-secondary{
  background:#fff !important;
  color:#145fc4 !important;
  border:2px solid #2b86df !important;
  box-shadow:none !important;
}
#gameScreen .instruction-player-name{
  color:#f57a1f !important;
  font-weight:900 !important;
}
#gameScreen .choose-one-line{
  display:block;
  margin-top:5px;
  font-weight:900;
}
@media(max-width:700px){
  .entry-v18 .captain-title{font-size:1.28rem;}
  .entry-v18 .captain-note{font-size:1rem;}
  .entry-v18 .choice-divider span{font-size:1.32rem;}
}

/* v1.14 — keep players in the active game after accidental mobile refresh */
html,body{overscroll-behavior-y:contain;}

.return-to-site{position:relative;display:block;width:max-content;max-width:90%;margin:12px auto 0;padding:9px 18px;background:#fff;border:2px solid #77bdd0;border-radius:24px;color:#173d52;text-decoration:none;font-weight:700;font-size:16px;z-index:10;box-shadow:0 2px 8px #0001}
.return-to-site:hover{background:#e9f8fc}

/* Short entry choice */
.welcome-choice{max-width:600px;margin:24px auto 34px;padding:16px 18px;text-align:center}
.choice-logo{display:block;width:min(200px,55vw);height:auto;margin:0 auto 12px;object-fit:contain}
.welcome-choice h1{margin:0 0 10px;font-size:clamp(30px,6vw,43px);color:#11185f}
.welcome-choice p{font-size:clamp(19px,3vw,23px);line-height:1.45;margin:0 0 24px;color:#273c57}
.choice-buttons{display:grid;gap:16px;max-width:440px;margin:0 auto 18px}
.choice-buttons button{width:100%;min-height:64px;font-size:clamp(21px,3vw,25px);font-weight:800;border-radius:18px;cursor:pointer}
.choice-demo{background:#fff7e8;color:#11185f;border:2px solid #f4a24d}
.choice-demo:hover{background:#ffefd0}
.welcome-choice .choice-note{font-size:16px;color:#55606e;margin:12px 0}
#backToChoiceBtn{display:block;margin:22px auto}
