:root { --speed: 300ms; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: repeating-linear-gradient(
    90deg,
    #ff4c4c 0px,   
    #ff4c4c 100px,
    #ffffff 100px, 
    #ffffff 200px
  );
  background-size: cover;
  color: #111;
}

h1 {
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: clamp(22px, 5vw, 55px);
  color: black;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
  margin: 12px 0 6px;
}

.score {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  margin: 8px 0 0;
}

.score div {
  background: #1e2340;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.table {
  position: relative;
  width: min(600px, 90vw);
  min-height: 260px;
  margin: 40px auto 0;

  background: #c19a6b;
  border: 8px solid #8b5a2b;
  border-radius: 12px;
  box-shadow: inset 0 8px 16px rgba(0,0,0,0.25),
              0 6px 12px rgba(0,0,0,0.30);
}

.cup {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 0);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: left var(--speed) ease, transform var(--speed) ease;
}

.cup-img {
  width: 120px;
  height: auto;
  display: block;
  pointer-events: none;
}

.cup.lift {
  transform: translate(-50%, -22px) rotate(-2deg);
}

.ball {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background-color: navy;
  border-radius: 50%;
  z-index: 1;
  transition: left var(--speed) ease, bottom 200ms ease, opacity 200ms ease;
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#startBtn {
  cursor: pointer;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: bold;
  background: #1e2340;  
  color: #ffffff;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 12px 16px rgba(0,0,0,0.24),
              0 17px 50px rgba(0,0,0,0.19);
  transition: background-color 0.2s ease, transform 0.15s ease;
}
#startBtn:hover { background: #2a3160; }
#startBtn:active { transform: scale(0.95); }


#status {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  background: #d62828;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  text-transform: uppercase;
  z-index: 5;
}
.hidden { display: none; }

#instructions {
  background: #f9f9f9;
  padding: 8px 12px;
  margin: 8px auto;   /* قللنا المارجن */
  border-radius: 8px;
  max-width: 500px;
  line-height: 1.4;
  font-size: 14px;
}
