/*
 * Styling inspired by Blue Skies Center (www.blueskiescenter.com)
 * Soft pastel colours, rounded cards and simple Hebrew typography.
 */

:root {
  /* Primary brand palette approximating the darker blue from the Blue Skies logo */
  --primary: #2a6fb1; /* deep sky blue for titles and buttons */
  --secondary: #ffe8a3; /* warm pastel yellow for highlights */
  --accent: #f2a3a3; /* soft coral accent used sparingly */
  --text: #333333; /* dark text for readability */
  --bg: #f6faff; /* very light background reminiscent of a clear sky */
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  direction: rtl;
}

/* Logo styling: ensure every page displaying the Blue Skies logo has
   consistent sizing and margin. */
.logo {
  /* Set a fixed height and crop the bottom of the logo image to avoid displaying
     any incorrect text that may be embedded in the graphic. Using object-fit
     and object-position ensures the top portion (cloud and sky) is shown.
     Adjust height if necessary to show the complete top graphic. */
  /* Increase the logo width so the full circular logo with rainbow
     and tagline is clearly visible. Maintain the aspect ratio by
     letting the height adjust automatically. */
  width: 160px;
  /* Reset height to auto since the new logo image contains only the graphic (cloud and sun).
     No cropping is necessary. */
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto 10px auto;
}

header{
  
  background-color: var(--primary);
  color: #fff;
  padding:1.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  display:flex;
  justify-content:space-between;
  align-items:center;
  direction:ltr;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;flex:1;text-align:center;margin:0;font-size:1.6rem;}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Cards on the home page */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/*
 * For menus with exactly four options (e.g. the home page), force two columns to
 * avoid displaying three cards in one row and a single card on the next.
 */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.game-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
.game-card h2 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--primary);
}
.game-card p {
  font-size: 0.9rem;
  margin: 10px 0 20px 0;
  height: 60px;
}
.game-card a {
  background-color: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.game-card a:hover {
  background-color: var(--accent);
}

/* General game page styling */
.game-container {
  max-width: 700px;
  margin: 40px auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.game-container h1 {
  color: var(--primary);
  margin-top: 0;
}
.instructions {
  font-size: 1rem;
  margin-bottom: 20px;
}
.back-link {
  display: inline-block;
  margin-top: 20px;
  background-color: var(--secondary);
  color: #333;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
}
.back-link:hover {
  background-color: var(--accent);
  color: #fff;
}

/*
 * General button style used in breathing exercises (arch, box, triangle)
 * and other action buttons that require a consistent appearance.
 */
.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: var(--secondary);
  color: var(--text);
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn:hover,
.btn:active {
  background-color: var(--accent);
  color: #fff;
}

/* Balloon game */
/* Balloon styling with gradient and glossy highlight */
/* Balloon graphic: use imported image instead of CSS radial gradient.
 * This container will be resized on interaction via JS.
 */
.balloon {
  width: 150px;
  height: 220px;
  margin: 40px auto;
  background-image: url('img/balloon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  transition: width 0.2s ease, height 0.2s ease;
  /* simple shadow for depth */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
/* hide decorative pseudo elements that were used in the CSS balloon before */
.balloon::before,
.balloon::after {
  display: none;
}

/* Counting game */
.count-bubbles {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.bubble {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at 30% 30%, var(--secondary) 0%, #ffffff 80%);
  border-radius: 50%;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  animation: float 4s ease-in-out infinite;
}
.bubble.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--accent);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Box breathing */
.box-container {
  width: 260px;
  height: 260px;
  margin: 40px auto;
  position: relative;
  border: 3px dashed var(--primary);
  border-radius: 12px;
  background-color: #eef7fb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.box-marker {
  width: 14px;
  height: 14px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: -7px;
  left: -7px;
  transition: all 1s linear;
}

/* Triangle breathing */
.triangle-container {
  width: 260px;
  height: 230px;
  margin: 40px auto;
  position: relative;
  background-color: #eef7fb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.triangle-line {
  position: absolute;
  width: 0;
  height: 0;
}
.triangle-marker {
  width: 12px;
  height: 12px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
  position: absolute;
  transition: all 1s linear;
}

/* Wave breathing */
/* Use an abstract wave image and slowly shift it horizontally */
.wave {
  width: 100%;
  height: 180px;
  background-image: url('img/wave.png');
  /* Position the wave image so the waves appear at the bottom of the container. */
  /* Stretch the wave image horizontally to allow smooth shifting and ensure the
     crests are visible within the 180px height. Avoid cropping the waves by
     defining the background dimensions explicitly. */
  background-size: 200% 100%;
  background-repeat: repeat-x;
  background-position-y: bottom;
  /* Animate horizontally and vertically to simulate a gentle wave. */
  animation: waveShift 12s linear infinite, waveUpDown 6s ease-in-out infinite;
}
@keyframes waveShift {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: -600px;
  }
}

/* Secondary keyframes for the wave animation: gently moves the wave
   background up and down to give a more realistic tidal feel. */
@keyframes waveUpDown {
  0%, 100% { background-position-y: bottom; }
  50% { background-position-y: calc(100% - 20px); }
}

/* Bee game */
/* Render the bee as an image that floats gently across the screen */
.bee {
  width: 80px;
  height: 80px;
  /* Override any default fly animation for the bee breathing exercise.
     The bee will be moved via JavaScript on its page, so keep it static here. */
  animation: none;
  margin-top: 0;
}
@keyframes fly {
  0% { transform: translateX(-160px) translateY(0); }
  25% { transform: translateX(0) translateY(-40px); }
  50% { transform: translateX(160px) translateY(0); }
  75% { transform: translateX(0) translateY(40px); }
  100% { transform: translateX(-160px) translateY(0); }
}

/* Positive thinking game */
.positive-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}
.positive-item {
  background-color: #fefaf0;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.positive-item.positive {
  background-color: var(--secondary);
  border-color: var(--accent);
}

/* Kindness jar hearts */
.jar-area {
  width: 250px;
  height: 350px;
  margin: 0 auto;
  background-image: url('img/jar.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
}
.hearts-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
/* heart shape created using CSS: a rotated square with two circles */
.heart {
  position: relative;
  width: 40px;
  height: 40px;
  transform: rotate(-45deg);
  background-color: var(--accent);
  cursor: pointer;
  transition: transform 0.6s;
}
.heart::before,
.heart::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  background-color: var(--accent);
  border-radius: 50%;
}
.heart::before {
  top: -20px;
  left: 0;
}
.heart::after {
  left: 20px;
  top: 0;
}
.heart.collected {
  position: absolute;
  transform: rotate(-45deg) scale(0.8);
  /* top and left will be set inline via JS to position inside jar */
}

/* Gratitude journal */
.gratitude-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.gratitude-form input[type="text"],
.gratitude-form textarea {
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 8px;
  font-size: 1rem;
  resize: vertical;
}
.gratitude-form button {
  align-self: flex-start;
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
}
.gratitude-form button:hover {
  background-color: var(--accent);
}

/* Mindfulness senses */
.senses-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}
.sense {
  width: 80px;
  height: 80px;
  background-color: #eef7fb;
  border: 2px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.sense.active {
  background-color: var(--secondary);
}

/* Emotions game */
.emotions-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}
.emotion {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #eef7fb;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.emotion.selected {
  background-color: var(--secondary);
  border-color: var(--accent);
}

/* Drawing canvas */
.drawing-area {
  border: 2px solid var(--primary);
  border-radius: 12px;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  background-color: #fff;
  cursor: crosshair;
}
.palette {
  margin: 15px auto;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.palette-color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: border-color 0.2s;
}
.palette-color.selected {
  border: 3px solid var(--accent);
}
.drawing-controls {
  text-align: center;
  margin-top: 10px;
}
.drawing-controls button {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.drawing-controls button:hover {
  background-color: var(--accent);
}

/* Stretch training */
.stretch-img {
  width: 200px;
  margin: 0 auto;
  display: block;
}
.stretch-bar-container {
  width: 80%;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  margin: 20px auto;
  position: relative;
}
.stretch-bar {
  height: 100%;
  width: 0;
  background-color: var(--secondary);
  border-radius: 8px;
  transition: width 0.1s;
}
.stretch-button {
  display: block;
  margin: 20px auto;
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.stretch-button:active {
  background-color: var(--accent);
}

/* Coordination game */
.coord-area {
  width: 300px;
  height: 300px;
  margin: 0 auto;
  border: 2px solid var(--primary);
  border-radius: 12px;
  position: relative;
  background-color: #fefaf0;
  overflow: hidden;
}
.coord-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  /* Background image will be set dynamically via JS (cloud or rainbow) */
  background-color: transparent;
  position: absolute;
  cursor: pointer;
  transition: transform 0.1s;
}
.coord-circle:hover {
  transform: scale(1.1);
}

/* Memory game */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 12px;
  justify-items: center;
  margin-top: 20px;
}
.memory-card {
  width: 70px;
  height: 70px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background-color: #fefaf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
.memory-card.matched {
  background-color: var(--secondary);
  border-color: var(--accent);
  cursor: default;
}
.memory-card.flipped {
  background-color: var(--secondary);
}

/* Star animation used in positive thinking and memory games */
.flying-star {
  position: absolute;
  font-size: 1.5rem;
  color: var(--accent);
  pointer-events: none;
  animation: flyStar 1.5s forwards ease-out;
}
@keyframes flyStar {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-50px) scale(1.4);
  }
}

/* Sticky note style for gratitude journal */
.sticky-note {
  background-color: #fff9c4;
  border: 2px solid var(--secondary);
  border-radius: 8px;
  padding: 10px;
  margin: 8px;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 200px;
  word-wrap: break-word;
}

/* Orange picking */
.tree {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  position: relative;
}
/* individual orange fruit uses the imported graphic */
.orange {
  width: 48px;
  height: 48px;
  background-image: url('img/orange.png');
  background-size: cover;
  background-position: center;
  position: absolute;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
.orange:hover {
  transform: scale(1.1);
}
.basket {
  width: 200px;
  min-height: 80px;
  background-image: url('img/basket.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  border: 2px solid var(--primary);
  border-radius: 10px;
  margin: 20px auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px 15px 25px 15px;
  color: var(--primary);
  flex-wrap: wrap;
}


html,body{
  height:100%;
  margin:0;
}





html{
  height:100%;
  background-color:#d9eefa; /* fallback colour while image loads */
}

body{
  min-height:100%;
  margin:0;
  background:rgba(255,255,255,0.5) url("img/background.png") center/cover fixed no-repeat;
  background-blend-mode:lighten; /* 50% like transparency */
}

header{padding:0.5rem 1rem;}




header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0.5rem 1rem;
  background:linear-gradient(90deg,var(--primary,#2a6fb1),var(--primary,#2a6fb1));
   /* תצוגה משמאל לימין עבור לוגו וכפתור */
}

header a.header-btn{
  background:#fff;
  color:var(--primary,#2a6fb1);
  padding:0.4rem 0.9rem;
  border-radius:9999px;
  font-weight:600;
  text-decoration:none;
  font-size:0.9rem;
}
header a.header-btn:hover{
  background:var(--secondary,#ffe8a3);
}



/* Center game/task cards */
.game-card,
.card{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}


header{
  position:relative;
}




header h1{
  margin:0 auto;
  font-size:1.6rem;flex:1;text-align:center;margin:0;font-size:1.6rem;}

header{
  padding-right:100px; /* space for button */
  padding-left:100px;  /* space for logo */
}


header{
  overflow:visible;
}

header .logo-link{
  position:absolute;
  left:1rem;
  top:100%;          /* מתחיל בבסיס הפס */
  transform:translateY(-50%); /* מעלה חצי מהגובה -> חצי בפס, חצי בחוץ */
}

header .logo-link img{
  width:120px;
  height:auto;
}


/* Override header height */
header{padding:1.5rem 1rem !important;}
