* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Улучшение для touch устройств */
@media (hover: none) and (pointer: coarse) {
  .primary-button,
  .secondary-button,
  .mode-button,
  .difficulty-button {
    min-height: 44px;
    min-width: 44px;
  }
  
  [type='radio'] + span::before {
    width: 2em;
    height: 2em;
  }
}

.not-visible {
  display: none;
}

.bg {
  background-color: rgb(219, 229, 228);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2392aca7' fill-opacity='0.43'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.convex {
  border-bottom-left-radius: 50% 30%;
  border-bottom-right-radius: 50% 20%;
}

.error {
  box-sizing: border-box;
  position: absolute;
  background-color: rgb(255, 117, 117);
  text-align: center;
  min-height: 40px;
  overflow: hidden;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10001;
  padding: 11px;
}

.error p {
  font-family: 'Lato', sans-serif;
  font-size: 18px;
  color: rgb(0, 0, 0);
  padding: 0;
  margin: 0;
}

.error ul {
  list-style: none;
  margin: 0;
  -webkit-padding-start: 0;
}

.error li {
  display: inline-block;
  padding: 0 7px;
}

.row {
  max-width: 1000px;
  padding: 20px 20px 0 20px;
  margin: 0 auto;
  text-align: center;
}

.row p {
  font-family: 'Lato', sans-serif;
  line-height: 1.8;
  font-size: 18px;
  padding: 0;
  margin: 0;
  color: rgb(59, 59, 59);
}

.navigation a,
.error a,
.row a {
  color: rgb(0, 0, 0);
  font-family: 'Lato', sans-serif;
  margin-top: 5px;
}

.navigation a {
  font-size: 18px;
}

.error a,
.row a {
  display: block;
  font-size: 15px;
}

/*------------------------------BUTTONS------------------------------*/
.primary-button {
  margin: 5px;
  font-family: 'Lato', sans-serif;
  text-transform: capitalize;
  font-size: 18px;
  padding: 16px;
  color: black;
  background-color: rgb(255, 127, 80);
  border: solid rgb(248, 96, 41) 2px;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.new-battle {
  display: block;
  margin: 20px auto;
  min-width: 200px;
}

.secondary-button {
  font-family: 'Lato', sans-serif;
  font-size: 18px;
  padding: 16px;
  color: rgb(1, 111, 111);
  background-color: transparent;
  border: solid rgb(1, 111, 111) 2px;
  cursor: pointer;
  margin: 5px;
}

@media only screen and (min-width: 500px) {
  .error {
    min-height: 60px;
    padding: 22px;
  }
}

@media only screen and (max-width: 640px) {
  .convex {
    border-bottom-left-radius: 50% 15%;
    border-bottom-right-radius: 50% 5%;
  }
  
  .row {
    padding: 15px 15px 0 15px;
  }
  
  .row p {
    font-size: 16px;
  }
  
  .primary-button,
  .secondary-button {
    font-size: 16px;
    padding: 14px;
  }
}

@media only screen and (max-width: 400px) {
  .row {
    padding: 10px 10px 0 10px;
  }
  
  .row p {
    font-size: 14px;
  }
  
  .primary-button,
  .secondary-button {
    font-size: 14px;
    padding: 12px;
  }
}

@media only screen and (max-width: 1000px) {
  .convex {
    border-bottom-left-radius: 50% 20%;
    border-bottom-right-radius: 50% 10%;
  }
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  margin: 0 10px;
  font-family: 'Lato', sans-serif;
  color: inherit;
  z-index: 10;
  position: relative;
}

.lang-switcher .lang-link {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  opacity: 0.6;
  padding: 5px;
  font-size: 16px;
  transition: opacity 0.2s;
  cursor: pointer;
  margin-top: 0 !important;
}

.lang-switcher .lang-link:hover,
.lang-switcher .lang-link.active {
  opacity: 1;
}

.lang-switcher .divider {
  margin: 0 5px;
  opacity: 0.4;
}
