* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Century Gothic", Arial, sans-serif;
  color: #10213f;
}

body {
  overflow: hidden;
}

.home-screen {
  width: 100vw;
  height: 100vh;
  background-image: url("images/hero-banner.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 5vw 4vh;
}

.button-panel {
  width: min(1500px, 92vw);
  background: rgba(255, 255, 255, 0.94);
  border: 4px solid rgba(255, 255, 255, 0.95);
  border-radius: 34px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  padding: 26px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.home-btn {
  border: none;
  border-radius: 20px;
  padding: 18px 14px 16px;
  min-height: 155px;
  cursor: pointer;
  color: white;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.25), 0 12px 22px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, filter 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.home-btn:hover {
  transform: translateY(-5px);
  filter: brightness(1.05);
}

.home-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

.home-btn.play { background: linear-gradient(135deg, #1e63ff, #7b2ff7); }
.home-btn.recent { background: linear-gradient(135deg, #ff5b22, #ef3f73); }
.home-btn.popular { background: linear-gradient(135deg, #f6c400, #ff7a00); }
.home-btn.teacher { background: linear-gradient(135deg, #1ebc48, #07896e); }
.home-btn.about { background: linear-gradient(135deg, #17bfd4, #0d7fa0); }

.btn-icon {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 8px;
}

.btn-title {
  font-size: clamp(20px, 1.8vw, 32px);
  text-transform: uppercase;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.btn-subtitle {
  display: block;
  color: #0d1b3d;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 7px 10px;
  margin-top: 12px;
  font-size: clamp(12px, 1vw, 17px);
  font-weight: 800;
  text-transform: none;
  text-shadow: none;
}

.blog-link {
  margin-top: 18px;
  color: #ffe44d;
  background: rgba(0, 25, 65, 0.78);
  text-decoration: underline;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: clamp(15px, 1.6vw, 24px);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 35, 0.68);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 50;
}

.popup-overlay.show {
  display: flex;
}

.popup {
  width: min(1050px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 30px;
  padding: 42px;
  box-shadow: 0 15px 0 rgba(10, 25, 55, 0.65), 0 25px 55px rgba(0, 0, 0, 0.45);
  position: relative;
}

.wide-popup {
  width: min(1320px, 94vw);
}

.close-btn {
  position: sticky;
  top: 0;
  float: right;
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 50%;
  background: #fb4444;
  color: white;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.popup h2 {
  margin: 0 80px 8px 0;
  font-size: clamp(42px, 5vw, 76px);
  color: #2c65e8;
  line-height: 1.05;
}

.popup-subtitle {
  font-size: 24px;
  color: #61708a;
  font-weight: 800;
  margin: 0 0 24px;
}

.game-search {
  width: 100%;
  padding: 17px 22px;
  border-radius: 18px;
  border: 3px solid #d8e3f2;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
}

.game-search:focus {
  outline: none;
  border-color: #2c65e8;
  box-shadow: 0 0 0 4px rgba(44, 101, 232, 0.14);
}

.category-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.category-tab {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  background: #eaf1ff;
  color: #23416b;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.category-tab.active {
  background: #2c65e8;
  color: white;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.game-card {
  border: 2px solid #dce5f0;
  border-radius: 22px;
  padding: 18px;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.game-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  background: #dbeafe;
}

.game-card h3 {
  margin: 16px 0 8px;
  font-size: 25px;
  color: #16243b;
  line-height: 1.15;
}

.game-card p {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.35;
  color: #526176;
  font-weight: 700;
}

.card-btn {
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: center;
  background: #2c65e8;
  color: white;
  text-decoration: none;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 21px;
  font-weight: 900;
}

.simple-list {
  display: grid;
  gap: 14px;
}

.simple-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border: 2px solid #dce5f0;
  background: #f8fbff;
  padding: 18px 20px;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 900;
}

.simple-item a {
  background: #2c65e8;
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  white-space: nowrap;
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.teacher-card {
  background: #eef6ff;
  border: 2px solid #cfe2ff;
  padding: 22px;
  border-radius: 18px;
  font-size: 21px;
  font-weight: 900;

  text-decoration: none;
  color: #1f2d3d;
  display: block;
  transition: 0.2s ease;
}

.teacher-card:hover {
  transform: translateY(-3px);
  background: #e4f0ff;
}

.website-box {
  background: #eef6ff;
  border: 2px solid #b7d7ff;
  border-radius: 18px;
  padding: 22px;
  margin: 24px 0;
  font-size: 20px;
}

.website-box a {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  font-weight: 900;
  color: #2563eb;
  word-break: break-word;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 20px;
}

.contact-form h3 {
  margin: 0 0 6px;
  color: #1e3a8a;
  font-size: 28px;
}

.contact-form label {
  font-weight: 900;
  color: #1f3150;
}

.contact-form input,
.contact-form textarea {
  padding: 15px;
  border: 2px solid #d7deea;
  border-radius: 12px;
  font-size: 17px;
  font-family: inherit;
}

.contact-form button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.empty-message {
  grid-column: 1 / -1;
  text-align: center;
  background: #fff7d6;
  border: 2px solid #facc15;
  padding: 24px;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 900;
}

@media (max-width: 1050px) {
  .button-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .home-screen {
    min-height: 100vh;
    height: auto;
    padding: 40vh 4vw 3vh;
    background-position: center top;
  }

  .button-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
  }

  .home-btn {
    min-height: 92px;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-start;
    padding: 14px 18px;
  }

  .btn-icon {
    margin: 0;
  }

  .btn-subtitle {
    display: none;
  }

  .blog-link {
    font-size: 14px;
    padding: 10px 16px;
  }

  .popup {
    padding: 28px 20px;
    border-radius: 24px;
  }

  .close-btn {
    width: 56px;
    height: 56px;
    font-size: 38px;
  }

  .game-grid,
  .teacher-grid {
    grid-template-columns: 1fr;
  }

  .simple-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
