@import url('https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

body {
  font-family: 'Press Start 2P', sans-serif;
  color: #eee;
  background-color: #222;
  /* background-color: #60b347; */
}

/* LAYOUT */
header {
  position: relative;
  height: 35vh;
  border-bottom: 7px solid #eee;
}

main {
  height: 65vh;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.left {
  width: 52rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.right {
  width: 52rem;
  font-size: 2rem;
}

/* ELEMENTS STYLE */
h1 {
  font-size: 4rem;
  text-align: center;
  position: absolute;
  width: 100%;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.number {
  background: #eee;
  color: #333;
  font-size: 6rem;
  width: 15rem;
  padding: 3rem 0rem;
  text-align: center;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
}

.between {
  font-size: 1.4rem;
  position: absolute;
  top: 2rem;
  right: 2rem;
}

.again {
  position: absolute;
  top: 2rem;
  left: 2rem;
}

.guess {
  background: none;
  border: 4px solid #eee;
  font-family: inherit;
  color: inherit;
  font-size: 5rem;
  padding: 2.5rem;
  width: 25rem;
  text-align: center;
  display: block;
  margin-bottom: 3rem;
}

.btn {
  border: none;
  background-color: #eee;
  color: #222;
  font-size: 2rem;
  font-family: inherit;
  padding: 2rem 3rem;
  cursor: pointer;
}

.btn:hover {
  background-color: #ccc;
}

.message {
  margin-bottom: 8rem;
  height: 3rem;
}

.label-score {
  margin-bottom: 2rem;
}

/* disabled btn check */
.check:disabled {
  background-color: #555;   /* رمادي غامق */
  color: #aaa;              /* نص باهت */
  cursor: not-allowed;      /* مؤشر الفأرة ممنوع */
  opacity: 0.6;             /* شفاف شوية */
}

/* ===== Mobile tweaks (append-only) ===== */

/* Make layout stack on smaller screens */
@media (max-width: 900px) {
  main {
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    height: auto;            /* allow content height */
    padding: 3rem 2rem;
  }

  .left, .right {
    width: 100%;
    max-width: 42rem;        /* prevent overly wide blocks */
  }

  header {
    height: 28vh;            /* a bit shorter on mobile */
  }

  h1 {
    font-size: 3rem;
    top: 50%;
  }

  .between, .again {
    font-size: 1.2rem;
  }

  .number {
    font-size: 4.8rem;
    width: 12rem;
    padding: 2rem 0;
    transform: translate(-50%, 40%); /* less overlap */
  }

  .guess {
    width: min(90vw, 28rem);
    font-size: 3.2rem;
    padding: 1.8rem;
  }

  .btn {
    font-size: 1.8rem;
    padding: 1.6rem 2.4rem;
  }

  .message {
    margin-bottom: 4rem; /* less empty space */
  }
}

/* Very small phones */
@media (max-width: 480px) {
  header {
    height: 24vh;
  }

  h1 {
    font-size: 2.4rem;
  }

  .between, .again {
    top: 1.2rem;
  }

  .between {
    right: 1.2rem;
    font-size: 1.1rem;
  }

  .again {
    left: 1.2rem;
    font-size: 1.1rem;
    padding: 1rem 1.4rem;
  }

  .number {
    font-size: 4rem;
    width: 10rem;
    padding: 1.6rem 0;
    transform: translate(-50%, 35%);
  }

  .guess {
    width: 88vw;
    font-size: 2.6rem;
    padding: 1.4rem;
    border-width: 3px;
    margin-bottom: 2rem;
  }

  .btn {
    font-size: 1.6rem;
    padding: 1.2rem 1.8rem;
  }

  .right {
    font-size: 1.8rem;
  }
}

/* Improve tap targets and focus states (accessibility) */
.btn, .guess {
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible,
.guess:focus-visible {
  outline: 3px dashed #60b347;
  outline-offset: 4px;
  border-radius: 8px;
}

/* Prefer reduced motion: keep UX friendly for sensitive users */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}