/* ===== Base  CSS ===== */
/* ===== Remove-Item Env:BASE_URL -ErrorAction SilentlyContinue; npx playwright test ===== */
/* ===== $env:BASE_URL="https://english-for-lian.netlify.app"; npx playwright test ===== */
/* ===== npx http-server -p 5500===== */
/* ===== firebase deploy --only functions:gameAction===== */
/* ===== firebase emulators:start --only functions,firestore===== */
/* ===== firebase emulators:start===== */





body{
  font-family: "Arial Rounded MT Bold", Arial, sans-serif;
  background-image: url("../img/wall.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  margin: 0;
  padding: 20px;
  color: #111827;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  position: relative;
}


body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.35) 0 14px, rgba(255,255,255,0) 15px),
    radial-gradient(circle at 28% 10%, rgba(255,255,255,0.30) 0 12px, rgba(255,255,255,0) 13px),
    radial-gradient(circle at 66% 16%, rgba(255,255,255,0.32) 0 16px, rgba(255,255,255,0) 17px),
    radial-gradient(circle at 84% 12%, rgba(255,255,255,0.28) 0 11px, rgba(255,255,255,0) 12px),
    radial-gradient(circle at 18% 70%, rgba(255,255,255,0.26) 0 10px, rgba(255,255,255,0) 11px),
    radial-gradient(circle at 78% 78%, rgba(255,255,255,0.24) 0 12px, rgba(255,255,255,0) 13px);
  filter: blur(0.2px);
  opacity: 0.15;
  animation: cloudDrift 22s ease-in-out infinite;
}


body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 10% 30%, rgba(255,255,255,0.22) 0 2px, rgba(255,255,255,0) 3px),
    radial-gradient(circle at 30% 60%, rgba(255,255,255,0.18) 0 2px, rgba(255,255,255,0) 3px),
    radial-gradient(circle at 55% 25%, rgba(255,255,255,0.20) 0 2px, rgba(255,255,255,0) 3px),
    radial-gradient(circle at 70% 55%, rgba(255,255,255,0.16) 0 2px, rgba(255,255,255,0) 3px),
    radial-gradient(circle at 85% 35%, rgba(255,255,255,0.14) 0 2px, rgba(255,255,255,0) 3px);
  opacity: 0.2;
  animation: sparkleFloat 10s ease-in-out infinite;
}

@keyframes cozySky{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 55%; }
  100%{ background-position: 0% 50%; }
}

@keyframes cloudDrift{
  0%{ transform: translate3d(-1.5%, -0.5%, 0); opacity: 0.85; }
  50%{ transform: translate3d(1.5%, 0.7%, 0); opacity: 0.95; }
  100%{ transform: translate3d(-1.5%, -0.5%, 0); opacity: 0.85; }
}

@keyframes sparkleFloat{
  0%{ transform: translate3d(0, 0, 0); filter: blur(0px); }
  50%{ transform: translate3d(0, -6px, 0); filter: blur(0.3px); }
  100%{ transform: translate3d(0, 0, 0); filter: blur(0px); }
}





.fireworks,
.global-star{
  position: fixed;
  left: 0;
  right: 0;
  max-width: 100vw;
  overflow: hidden;
}

*{
  box-sizing: border-box;
}


.game-stats{
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
    margin-top: 6px;
}

.stat-pill{
  background: rgba(255,255,255,0.85);
  border: 2px dashed rgba(236,72,153,0.35);
  padding: 8px 12px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 14px;
  color: #7c3aed;
  box-shadow: 0 10px 18px rgba(0,0,0,0.06);
  pointer-events: none;
}

.stat-pill span{
  color: #111827;
}

/* ===== Logical game components always LTR ===== */

.game-stats,
.bingo-board,
.keyboard,
#keyboard,
#wordArea,
.word-area,
.word-letters,
.memory-grid,
.memory-board {
  direction: ltr;
}

/* ===== Text containers follow app language ===== */

.topbar,
.topbar-title,
.bingo-instructions,
.bingo-translation,
.stat-pill,
.finish-card,
.lose-card {
  direction: inherit;
}


@keyframes bgFlow{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

.app{
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
}



.card{
  background: rgba(255,255,255,0.12);
  
  margin: 24px auto;
  padding: 28px;
  border-radius: 28px;
  box-shadow: 0 20px 44px rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}

body.shop-page .card{
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
}








.card > *{
  position: relative;
  z-index: 1;
}

@keyframes cardAura{
  0%{
    background-position: 0% 0%;
    opacity: 0.55;
  }
  50%{
    background-position: 40% 60%;
    opacity: 0.85;
  }
  100%{
    background-position: 0% 0%;
    opacity: 0.55;
  }
}

@keyframes cardFloat{
  0%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
  100%{ transform: translateY(0); }
}

.title{
  font-size: 34px;
  font-weight: 800;
  margin: 10px 0 6px;
}

.subtitle{
  font-size: 16px;
  color: #374151;
  margin: 0 0 18px;
}

.btn-start{
  border-radius: 26px;
  padding: 18px 16px;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 18px 34px rgba(236,72,153,0.22);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

.btn-start:hover{
  filter: brightness(1.06);
  box-shadow: 0 22px 40px rgba(236,72,153,0.28);
}

.btn-start:active{
  transform: scale(0.97);
}


.btn{
  display: block;
  width: 100%;
  text-decoration: none;
  border: 0;
  border-radius: 16px;
  padding: 16px 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  margin: 10px 0;
  color: #111827;
}

.btn:hover{
  transform: scale(1.02);
  filter: brightness(0.98);
}

.btn:active{
  transform: scale(0.99);
}

.btn-blue{ background: #93c5fd; }
.btn-green{ background: #86efac; }
.btn-purple{ background: #c4b5fd; }
.btn-yellow{ background: #fde68a; }
.btn-gray{ background: #e5e7eb; }

.topbar{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding-top: 44px;
  flex-wrap: wrap;
}




.topbar .back{
  position: absolute;
  left: 0;
  top: 0;
}

.topbar #resetBtn{
  position: absolute;
  right: 0;
  top: 0;
}


.topbar-title{
  font-weight: 900;
  font-size: 34px;
  text-align: center;
  color: #7c3aed;
  background: linear-gradient(135deg, #fde2f3, #e0e7ff, #fbcfe8);
  background-size: 200% 200%;
  padding: 16px 22px;
  border-radius: 26px;
  margin: 6px auto 14px;
  box-shadow: 0 12px 26px rgba(124,58,237,0.18);
  letter-spacing: 0.2px;
  animation: titleShine 3.2s ease-in-out infinite;
}



.topbar .back,
.topbar #resetBtn{
  width: auto;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
}



@keyframes titleBounceSoft{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}
@keyframes titleShine{
  0%{ background-position: 0% 50%; transform: scale(1); }
  50%{ background-position: 100% 50%; transform: scale(1.03); }
  100%{ background-position: 0% 50%; transform: scale(1); }
}



.back{
  background: linear-gradient(135deg, #fbcfe8, #e0e7ff);
  border: 2px solid rgba(236,72,153,0.35);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: #374151;
  box-shadow:
    0 8px 18px rgba(236,72,153,0.25),
    inset 0 2px 6px rgba(255,255,255,0.9);
  animation: backFloat 2.6s ease-in-out infinite;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.back:hover{
  transform: scale(1.06);
  filter: brightness(1.05);
}

.back:active{
  transform: scale(0.95);
}


.scoreRow{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  margin-bottom: 10px;
}

.stars{
  font-size: 20px;
  letter-spacing: 2px;
  animation: starBlink 1.8s ease-in-out infinite;
}

@keyframes starBlink{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.2); }
  100%{ transform: scale(1); }
}
@keyframes backFloat{
  0%{ transform: translateY(0); }
  50%{ transform: translateY(-4px); }
  100%{ transform: translateY(0); }
}


.audioBtn{
  margin-top: 14px;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  background: #fde68a;
  font-weight: 700;
}

.help{
  margin-top: 10px;
  color: #374151;
  cursor: pointer;
  font-size: 15px;
  text-decoration: underline;
}

.hebrew{
  display: none;
  margin-top: 10px;
  color: #111827;
  font-size: 16px;
}
#nameScreen {
  max-width: 340px;
  margin: 40px auto;
  text-align: center;
}

#nameScreen .title {
  font-size: 26px;
  font-weight: 800;
  color: #ec4899;
  margin-bottom: 10px;
}

#nameScreen .subtitle {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 16px;
}

#nameScreen input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px;
  font-size: 18px;
  border-radius: 16px;
  border: 2px solid #f9a8d4;
  outline: none;
  text-align: center;
  margin-bottom: 14px;
}


#nameScreen input:focus {
  border-color: #ec4899;
}

#nameScreen .btn {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 18px;
}

#kpopGirl{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 140px;
  opacity: 0;
  pointer-events: none;
  z-index: 2147483647;
}


.kpop-show{
  animation: kpopWave 2.2s ease-out forwards;
}

@keyframes kpopWave{
  0%{
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  20%{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  60%{
    opacity: 1;
    transform: translateY(-6px) scale(1.04);
  }
  100%{
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }
}
.fireworks{
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000000;
  pointer-events: none;
  contain: layout paint;
}


.firework{
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.firework .burst{
  position: absolute;
  inset: 0;
  transform: translateZ(0);
  animation: fwBurst 2000ms ease-out forwards;
}

.firework .burst::before,
.firework .burst::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.firework .burst::before{
  box-shadow:
    0 -90px #ff4fd8,
    64px -64px #facc15,
    90px 0 #86efac,
    64px 64px #93c5fd,
    0 90px #f472b6,
    -64px 64px #c4b5fd,
    -90px 0 #fde68a,
    -64px -64px #fb7185,
    0 -55px #ffffff,
    39px -39px #ffffff,
    55px 0 #ffffff,
    39px 39px #ffffff,
    0 55px #ffffff,
    -39px 39px #ffffff,
    -55px 0 #ffffff,
    -39px -39px #ffffff;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.12));
  transform: rotate(var(--r1, 0deg));
}

.firework .burst::after{
  box-shadow:
    0 -70px #ff4fd8,
    50px -50px #fbcfe8,
    70px 0 #93c5fd,
    50px 50px #86efac,
    0 70px #facc15,
    -50px 50px #c4b5fd,
    -70px 0 #fde68a,
    -50px -50px #fb7185,
    0 -35px #ffffff,
    25px -25px #ffffff,
    35px 0 #ffffff,
    25px 25px #ffffff,
    0 35px #ffffff,
    -25px 25px #ffffff,
    -35px 0 #ffffff,
    -25px -25px #ffffff;
  opacity: 0.9;
  transform: rotate(var(--r2, 18deg)) scale(0.9);
  filter: blur(0.2px);
}

.firework .spark{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff 0%, rgba(255,255,255,0.0) 65%);
  animation: fwSpark 2000ms ease-out forwards;
  opacity: 0.95;
}

.firework .spark::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 60px;
  transform: translate(-50%, -10px) rotate(var(--tr, 0deg));
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.0), rgba(255,255,255,0.8), rgba(255,255,255,0.0));
  opacity: 0.7;
}

@keyframes fwBurst{
  0%{
    transform: scale(0.15);
    opacity: 0;
  }
  12%{
    opacity: 1;
  }
  55%{
    transform: scale(1.15);
    opacity: 1;
  }
  100%{
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes fwSpark{
  0%{
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
  }
  18%{
    opacity: 1;
  }
  100%{
    transform: translate(-50%, 30px) scale(1.3);
    opacity: 0;
  }
}











/* ===== Shared Pretty Keyboard ===== */
.keyboard{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.key-btn{
  padding: 12px 0;
  border-radius: 14px;
  border: none;
  background: #f9a8d4;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease;
}

.key-btn:active{
  transform: scale(0.95);
}

.key-btn.used,
.key-btn:disabled{
  background: #e5e7eb;
  color: #9ca3af;
  cursor: default;
}








@keyframes titleBounce{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.08) rotate(-2deg); }
  100%{ transform: scale(1); }
}








@keyframes sadBounce{
  0%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
  100%{ transform: translateY(0); }
}



.btn-start{
  animation: startPulse 2.4s ease-in-out infinite;
}

.sound-toggle{
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 14px;
  color: #374151;
}

.sound-toggle input{
  width: 18px;
  height: 18px;
  accent-color: #ec4899;
  cursor: pointer;
}


/* Hebrew RTL fix */
[lang="he"], 
.rtl-text {
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: right;
}







@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
.magic-bubbles{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.magic-bubble{
  position: absolute;
  bottom: -60px;
  width: 48px;
  height: 22px;
  opacity: 0;
  filter: blur(3px);
  background:
    radial-gradient(circle at 20% 60%, rgba(255,255,255,0.35) 0 14px, rgba(255,255,255,0) 15px),
    radial-gradient(circle at 45% 40%, rgba(255,255,255,0.45) 0 18px, rgba(255,255,255,0) 19px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.35) 0 14px, rgba(255,255,255,0) 15px);
  animation: bubbleFloat 26s ease-in-out infinite;
}



.magic-bubble:nth-child(1){ left: 15%; animation-delay: 0s; }
.magic-bubble:nth-child(2){ left: 35%; animation-delay: 4s; }
.magic-bubble:nth-child(3){ left: 55%; animation-delay: 8s; }
.magic-bubble:nth-child(4){ left: 75%; animation-delay: 12s; }

@keyframes bubbleFloat{
  0%{
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  10%{
    opacity: 0.6;
  }
  90%{
    opacity: 0.6;
  }
  100%{
    transform: translateY(-120vh) scale(1.2);
    opacity: 0;
  }
}



























@media (max-width: 520px){
  .topbar-title{
    font-size: 15px;
  }

  .memory-card:hover{
    transform: none;
  }

  .memory-card.open{
    transform: none;
  }
}

:focus-visible {
  outline: 3px solid #ff69b4;
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #ff69b4;
  outline-offset: 3px;
}

.a11y-fab{
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 999999;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.15);
  color: #111827;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  opacity: 0.95;
  transition: opacity 200ms ease, transform 200ms ease, filter 200ms ease;
}

.a11y-fab-hide{
  opacity: 0;
  transform: translateY(6px);
}

.a11y-fab-dim{
  opacity: 0.18;
  filter: saturate(0.7);
}

.a11y-fab-wake{
  opacity: 0.95;
  transform: translateY(0);
  filter: none;
}

.a11y-fab:hover{
  opacity: 0.95;
}

.a11y-fab:focus-visible{
  outline: 3px solid #ff69b4;
  outline-offset: 3px;
  opacity: 0.95;
}
#accessibilityScreen textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  margin: 12px 0 16px 0;
  border-radius: 14px;
  border: 2px solid #f3b7dd;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  outline: none;
}

#accessibilityScreen textarea:focus {
  border-color: #d77aff;
  box-shadow: 0 0 0 3px rgba(215,122,255,0.2);
}

/* ===== Accessibility Screen Text ===== */

.accessibility-subtitle{
  font-size: 17px;
  font-weight: 700;
  color: #6b21a8;
  margin: 6px 0 14px;
}

.accessibility-text{
  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.85);
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.accessibility-legal{
  font-size: 13px;
  color: #374151;
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
}














